function update_download_links() { global $wpdb; $table_name = $wpdb->prefix . ‘postmeta’; // Correct table name as per WordPress structure // SQL query to select the posts with specific meta key and a flexible URL pattern $results = $wpdb->get_results(“SELECT post_id, meta_value FROM…Continue reading
function update_download_links() { global $wpdb; $table_name = $wpdb->prefix . ‘postmeta’; // Correcting table name based on typical WordPress structure // SQL query to select the posts with specific meta key and URL format $results = $wpdb->get_results(“SELECT post_id, meta_value FROM {$table_name}…Continue reading
add_action(‘init’, function(){ add_theme_support(‘post-thumbnails’); add_image_size( ‘envira-gallery-thumbnail’, 75, 50, true ); }); add_filter(‘image_size_names_choose’, function($size_names){ $new_sizes = [ ‘envira-gallery-thumbnail’ => ‘Envira Gallery Thumbnail’ ]; return array_merge($size_names, $new_sizes); });Continue reading
/** * Disable all embeds in WordPress. */ add_action( ‘init’, function () { // Remove the REST API endpoint. remove_action( ‘rest_api_init’, ‘wp_oembed_register_route’ ); // Turn off oEmbed auto discovery. add_filter( ’embed_oembed_discover’, ‘__return_false’ ); // Don’t filter oEmbed results. remove_filter( ‘oembed_dataparse’,…Continue reading
add_filter( ‘woocommerce_shop_manager_editable_roles’, function( $roles ) { return array_merge( $roles, array( ‘customer_company’ ) ); } );Continue reading
add_filter(‘wpcode_pixel_event_name_tiktok’, function( $event_name, $event_key) { // Let’s send CompletePayment instead of PlaceAnOrder for purchase. if ( ‘purchase’ === $event_key ) { return ‘CompletePayment’; } return $event_name; }, 10, 2 );Continue reading
add_filter(‘wpcode_pixel_event_name_tiktok’, function( $event_name, $event_key) { if ( ‘purchase’ === $event_key ) { return ‘CompletePayment’; } return $event_name; }, 10, 2 );Continue reading
function custom_add_dashboard_widgets() { wp_add_dashboard_widget( ‘custom_news_feed_users_widget’, ‘News Feed Enabled Users’, ‘custom_display_news_feed_users’ ); } add_action(‘wp_dashboard_setup’, ‘custom_add_dashboard_widgets’); function custom_display_news_feed_users() { $user_query = new WP_User_Query(array( ‘meta_key’ => ‘iframe_toggle’, ‘meta_value’ => ‘1’ )); $users = $user_query->get_results(); $user_count = count($users); echo ‘ ‘; echo ‘ ‘;…Continue reading