This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('owf_review_step_total_reviews', function ($total_reviews, $review_setting, $action_history_id, $step_id) { | |
global $wpdb; | |
/** | |
* NEW: For steps requiring "everyone" to approve, if ANY reviewer has rejected (unable), | |
* auto-reject all remaining "assignment" reviews immediately so the failure branch proceeds now. | |
* We also persist these changes so inbox/reminders are cleaned up. | |
*/ | |
if ( ! empty( $total_reviews ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('owf_review_step_total_reviews', function ($total_reviews, $review_setting, $action_history_id, $step_id) { | |
global $wpdb; | |
/** | |
* NEW: For steps requiring "everyone" to approve, if ANY reviewer has rejected (unable), | |
* auto-reject all remaining "assignment" reviews immediately so the failure branch proceeds now. | |
* We also persist these changes so inbox/reminders are cleaned up. | |
*/ | |
if ( ! empty( $total_reviews ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [NEW] Per-assignee approval email | |
add_action( 'owf_individual_signoff_approved', 'send_individual_signoff_email', 10, 7 ); | |
/** | |
* [NEW] Send "assignment-style" email when an individual assignee approves a review step. | |
* Reuses the Assignment Email template via get_step_mail_content(), without needing the next action_id. | |
* | |
* @param int $post_id | |
* @param int $action_history_id Current step action_history_id | |
* @param int $actor_id Approver user ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [PATCH] Added custom placeholder "%last_signed_off_by%" for emails and its runtime resolver. | |
if ( ! function_exists( 'owf_register_last_signed_off_by_placeholder' ) ) { | |
function owf_register_last_signed_off_by_placeholder() { | |
// Show the placeholder label in the Step Info email editor (step-info-content.php) | |
add_filter( 'oasiswf_custom_placeholders', function( $placeholders ) { | |
if ( ! is_array( $placeholders ) ) { | |
$placeholders = array(); | |
} | |
// [PATCH] Added new placeholder label so it appears in the dropdown | |
$placeholders['%last_signed_off_by%'] = esc_html__( 'Last Signed off by', 'oasisworkflow' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function () { | |
var stepProcess = ""; | |
//------main function------------- | |
function load_setting() { | |
var allowed_post_types = jQuery.parseJSON( owf_submit_workflow_vars.allowedPostTypes ); | |
var current_post_type = jQuery( '#post_type' ).val(); | |
// check if role is applicable to submit to workflow | |
if ( current_post_type !== undefined ) { | |
var check_is_role_applicable = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A) Regenerate Elementor CSS for a specific post. | |
* | |
* Safe on Elementor 3.31.x. Only runs if the post is built with Elementor. | |
*/ | |
function ml_el_regenerate_post_css( $post_id ) { | |
if ( empty( $post_id ) || wp_is_post_revision( $post_id ) ) return; | |
if ( ! class_exists( '\Elementor\Plugin' ) ) return; | |
$run = function() use ( $post_id ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Run the Elementor media reconciliation AFTER One Click Demo Import finishes. | |
* | |
* Why priority 30? | |
* - Ensures your own after-import tasks (menus, front/blog pages, Replace URL, etc.) | |
* have already completed, so media IDs/URLs are normalized last. | |
* | |
* Hook names: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the team_id for a user from the {prefix}fc_team_members table. | |
* | |
* @param int $user_id User ID. | |
* @return int|false Team ID or false if none. | |
*/ | |
function owf_helmy_get_user_team_id( $user_id ) { | |
global $wpdb; | |
$table = $wpdb->prefix . 'fc_team_members'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Oasis Workflow: Per-Team Post Visibility & Admin Columns | |
* --------------------------------------------------------- | |
* - Restricts admin post list to show only posts for user's team (editors/authors) | |
* - Sets _team_id meta on new posts for configured post types | |
* - Shows "Team" column (with name) in admin for each Oasis-enabled post type | |
* | |
* @author Your Name | |
* @license GPL-2.0+ |
NewerOlder