Populate ACF Field with Post Types

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

Limit user posts

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

Change Products to Store in Breadcrumbs

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

Export Categories and Tags (copy)

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

Remove Price from Product schema

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

Filter Code to increase SEO Analyzer timeout

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

Modify breadcrumbs homepage link

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

ModalCSS

!function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){“undefined”!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:”Module”}),Object.defineProperty(e,”__esModule”,{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&”object”==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,”default”,{enumerable:!0,value:e}),2&t&&”string”!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,”a”,t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=””,o(o.s=1)}([function(e,t,o){“use strict”;function n(){return(n=Object.assign||function(e){for(var t=1;tContinue reading