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
/** | |
* Action hook triggered when a user submits a post/page to workflow or completes a step. | |
* | |
* Updates the due date of the action history record to the global default due date set in | |
* the Workflow Settings tab, if the default due date is set. | |
* | |
* @param int $post_id The ID of the post/page being submitted. | |
* @param int $action_history_id The ID of the action history record being updated. | |
*/ | |
function custom_modify_due_date_on_submit($post_id, $action_history_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
/** | |
* Enable support for post tags on pages. | |
*/ | |
function owf_add_tags_to_pages() { | |
register_taxonomy_for_object_type( 'post_tag', 'page' ); | |
} | |
add_action( 'init', 'owf_add_tags_to_pages' ); | |
// Add action to both front-end and admin to conditionally hide the Beaver Builder publish button. | |
add_action( 'admin_head', 'owf_hide_bb_publish_button' ); |
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
/** | |
* Duplicate custom permalink structure from original post to its revision post. | |
* | |
* @param int $new_post_id The ID of the new revision post. | |
* @param WP_Post $post The original post object. | |
* | |
* @since 3.2.0 | |
*/ |
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_unset_postmeta", "owf_unset_custom_permalink_meta", 20, 1); | |
function owf_unset_custom_permalink_meta( $post_metas ) { | |
// set custom permalink meta from the post_metas | |
$post_metas[] = 'custom_permalink'; | |
return $post_metas; | |
} |
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
/** | |
* Validate the editorial checklist condition. | |
* | |
* @param array $validation_result The validation result array passed by the filter. | |
* @param array $workflow_action_params The workflow action parameters array passed by the filter. | |
* | |
* @return array The validation result array with the error message and type. | |
*/ | |
function owf_ediotrial_checklist_validate_condition( $validation_result, $workflow_action_params ) { |
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
/** | |
* Filter to modify the 'oasiswf_placeholders' site option after it's retrieved. | |
* This ensures that our custom placeholder (%post_id%) is always available | |
* alongside the existing ones. | |
* | |
* @param array $value The existing array of placeholders. | |
* @return array Modified array with the additional %post_id% placeholder. | |
*/ | |
add_filter( 'site_option_oasiswf_placeholders', 'modify_existing_oasiswf_placeholders' ); |
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 | |
// Function to generate a random encryption key | |
function generateEncryptionKey($length = 32) | |
{ | |
return bin2hex(random_bytes($length)); | |
} | |
// Function to encrypt credit card information | |
function encryptCreditCard($creditCardNumber, $encryptionKey) |
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 shipping info by using chosen method from cart | |
* | |
* @param string $type | |
* @return string | |
*/ | |
function ml_get_shipping_data($type = '') { | |
$current_shipping_method = WC()->session->get( 'chosen_shipping_methods' ); | |
if( ! is_array($current_shipping_method) ) { | |
return ''; |
NewerOlder