// Hook to add admin submenu item under Posts add_action(‘admin_menu’, ‘custom_admin_submenu’); function custom_admin_submenu() { add_submenu_page( ‘edit.php’, // Parent slug (Posts menu) ‘Export Posts’, // Page title ‘Export Posts’, // Menu title ‘edit_posts’, // Capability ‘exported-posts’, // Menu slug ‘display_exported_posts’ //…Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
#– Allow Shop Manager to access Product Feed menus –# function allow_feed_menus_to_shop_manager() { return ‘manage_woocommerce’; } add_filter( ‘woosea_user_cap’, ‘allow_feed_menus_to_shop_manager’ ); #– Add Product Feed Manage Capability to Shop Manager Role –# function add_adt_cap_to_shop_manager() { $role = get_role( ‘shop_manager’ ); if(…Continue reading
add_filter( ‘envira_whitelabel_envira_deeplinking_slug’, ‘custom_envira_deeplinking_slug’ ); add_filter( ‘envira_whitelabel’, ‘__return_true’ ); function custom_envira_deeplinking_slug( $slug_name ) { // Check if the custom slug is set via a constant or option $custom_slug = ‘my_custom_slug’; return $custom_slug; }Continue reading
add_filter( ‘gform_review_page’, ‘add_review_page’, 10, 3 ); function add_review_page( $review_page, $form, $entry ) { // Enable the review page $review_page[‘is_enabled’] = true; if ( $entry ) { // Populate the review page. $review_page[‘content’] = GFCommon::replace_variables( ‘{all_fields}’, $form, $entry ); } return…Continue reading
// Hook into the save_post action to set the YouTube thumbnail as the featured image function set_youtube_thumbnail_as_featured_image($post_id) { // Check if the post type is ‘video’ to avoid running on other post types if (get_post_type($post_id) !== ‘video’) { return; }…Continue reading
/** * Set a specific language Google reCAPTCHA. * * @link https://wpforms.com/developers/how-to-set-the-language-for-google-recaptcha/ */ function wpf_dev_recaptcha_language_wpml( $url ) { // Get my current language setting from WPML $my_current_lang = apply_filters( ‘wpml_current_language’, NULL ); // Set the language of my Google reCAPTCHA…Continue reading