Replace all the URLs in the Schema with the current URL

add_filter( ‘aioseo_schema_output’, ‘aioseo_schema_change_urls’ ); function aioseo_schema_change_urls( $graphs ) { if ( false === strpos( $_SERVER[‘REQUEST_URI’], ‘home-search/listing/’ ) ) { return $graphs; } $request_uri = explode( ‘?’, $_SERVER[‘REQUEST_URI’] ); $uri = trim( ( $request_uri[0] ?? ” ), ‘/’ ); $old_url =…Continue reading

Load all Customizer “Additional CSS” in Block Editor

// Load the Frontend customizer “Additonal CSS” in the block editor. add_action( ‘enqueue_block_editor_assets’, ‘wp_custom_css_cb’ ); // Uncomment below if you need to manually manipulate the CSS for the block editor. // add_action( ‘enqueue_block_editor_assets’, function() { // ob_start(); // wp_custom_css_cb(); //…Continue reading

Generated Snippet Post Type

// Register Custom Post Type function deathwish() { $labels = array( ‘name’ => _x( ‘Deathwishes’, ‘Post Type General Name’, ‘text_deathwish’ ), ‘singular_name’ => _x( ‘Deathwish’, ‘Post Type Singular Name’, ‘text_deathwish’ ), ‘menu_name’ => __( ‘Deathwishes’, ‘text_deathwish’ ), ‘name_admin_bar’ => __(…Continue reading

Beecee – My coach WpdataTables (SC_Coach_wpdatatable)

function FN_Coach_wpdatatable ( $atts ) { // Initialize user_id to empty $user_id = ”; // Get the user ID from dropdown list post form if (isset($_POST[‘action’]) && $_POST[‘action’] === ‘Beecee_GroupLeader_user_do’) { $user_id = intval($_POST[‘user-id’]); } // Check if $user_id is…Continue reading

Order WPCode snippets by title in the admin

add_filter( ‘wpcode_code_snippets_table_prepare_items_args’, function( $args ) { if ( ! isset( $_GET[‘orderby’] ) ) { $args[‘orderby’] = ‘title’; } if ( ! isset( $_GET[‘order’] ) ) { $args[‘order’] = ‘ASC’; } return $args; });Continue reading

Export Categories and Tags

function export_tags_and_categories() { $terms = get_terms( array( ‘category’, ‘post_tag’ ), array( ‘hide_empty’ => false ) ); $output = fopen( ‘php://output’, ‘w’ ); fputcsv( $output, array( ‘Term ID’, ‘Name’, ‘Slug’, ‘Description’, ‘Taxonomy’ ) ); foreach ( $terms as $term ) {…Continue reading

MWM IWP Results Tables

?> MedWeight Individual Weight Program Domain Score Food Environment <td style='–size:; –color:;’> Appetite <td style='–size:; –color:;’> Food Reward <td style='–size:; –color:;’> Sleep <td style='–size:; –color:;’> Physical Activity <td style='–size:; –color:;’> Stress <td style='–size:; –color:;’>   Understanding Your Results Your score…Continue reading