function acf_load_post_types_populate_field( $field ) { // reset choices $field[‘choices’] = array(); // Get post types $args = array( ‘public’ => true, ); $post_types = get_post_types( $args, ‘objects’ ); unset( $post_types[‘attachment’] ); foreach ( $post_types as $post_type ) { $value =…Continue reading
// Create the settings page function restrict_user_posts_settings_page() { add_options_page( ‘Restrict User Posts Settings’, ‘Restrict User Posts’, ‘manage_options’, ‘restrict-user-posts-settings’, ‘restrict_user_posts_settings_page_content’ ); } add_action(‘admin_menu’, ‘restrict_user_posts_settings_page’); // Display the settings page content function restrict_user_posts_settings_page_content() { ?>Continue reading
add_filter( ‘aioseo_breadcrumbs_trail’, ‘homeshop_breadcrumbs_trail’ ); function homeshop_breadcrumbs_trail( $crumbs ) { foreach ( $crumbs as &$crumb ) { if(false !== is_product()){ if ( ‘Products’ === $crumb[‘label’] ) { $crumb[‘label’] = ‘Store’; } } } return $crumbs; }Continue reading
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
add_filter( ‘aioseo_schema_output’, ‘aioseo_product_schema_remove_price’ ); function aioseo_product_schema_remove_price( $schema ) { foreach ( $schema as $index => $graph ) { if ( ‘Product’ === $graph[‘@type’] ) { if ( ! empty( $graph[‘offers’][‘price’] ) ) { unset( $schema[ $index ][‘offers’][‘price’] ); } }…Continue reading
add_filter( ‘aioseo_canonical_url’, ‘aioseo_filter_canonical_url’ ); function aioseo_filter_canonical_url( $url ) { return ”; }Continue reading
add_filter( ‘http_request_args’, ‘aioseo_filter_analyzer_timeout’, 1, 2 ); function aioseo_filter_analyzer_timeout( $args, $url ) { if ( ‘https://analyze.aioseo.com/v1/analyze/’ === $url ) { $args[‘timeout’] = 120; } return $args; }Continue reading
add_filter( ‘aioseo_breadcrumbs_trail’, ‘homeshop_breadcrumbs_trail’ ); function homeshop_breadcrumbs_trail( $crumbs ) { foreach ( $crumbs as &$crumb ) { if ( ‘homePage’ === $crumb[‘type’] ) { $siteLink = wp_parse_url( $crumb[‘link’] ); $crumb[‘link’] = $siteLink[‘scheme’] . ‘://’ . $siteLink[‘host’] . ‘/shop-displays/’; } } return…Continue reading