How To Allow Shop Manager to Manage Feeds?

#– 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

Envira – Use a custom slug for the deeplinking

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

Gravity Forms Native Review Page

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

Use YouTube Thumbnail as Featured Image

// 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

(cloud) r2c on Call Param

add_action(‘wp_head’, function() { $complete_url = (isset($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] === ‘on’ ? “https” : “http”) . “://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]”; if (strpos($complete_url, ‘?call=’) !== false || strpos($complete_url, ‘&call=’) !== false) { $userAgent = $_SERVER[‘HTTP_USER_AGENT’] ?? ”; $searchEngines = [‘google’, ‘bing’, ‘msn’, ‘yandex’, ‘baidu’, ‘duckduck’,…Continue reading

Disable some Top WP Admin Bar

add_action(‘admin_bar_menu’, ‘remove_admin_bar_items’, 100); function remove_admin_bar_items($wp_admin_bar) { // Example: Remove the WordPress logo $wp_admin_bar->remove_node(‘wp-logo’); // Example: Remove the “Comments” menu $wp_admin_bar->remove_node(‘comments’); // Example: Remove the “Comments” menu $wp_admin_bar->remove_node(‘updates’); // Add more nodes as needed }Continue reading

RingBa: PHP Hide For Bots

//global $js_tag_id; //$js_tag_id = “CA365bab17031a47acab84c70a32d28015″; if (!defined(‘ABSPATH’)) exit; function is_search_engine_bot() { $userAgent = $_SERVER[‘HTTP_USER_AGENT’] ?? ”; if (stripos($userAgent, ‘google’) !== false || stripos($userAgent, ‘bing’) !== false || stripos($userAgent, ‘msn’) !== false || stripos($userAgent, ‘yandex’) !== false || stripos($userAgent, ‘baidu’) !==…Continue reading

Lock users if website is idle for certain period ウェブサイトが一定期間アイドル状態の場合にユーザーをロックするBy Amiru San

/** * Lock user out after 5 minutes of inactivity by Amiru ウェブサイトが一定期間アイドル状態の場合にユーザーをロックする. */ add_action( ‘init’, ‘lock_user_after_inactivity’ ); function lock_user_after_inactivity() { // Check if the user is logged in if ( is_user_logged_in() ) { // Get the current user ID…Continue reading