Type: php
Disable XML-RPC (copy)
add_filter( ‘xmlrpc_enabled’, ‘__return_false’ );Continue reading
Disable XML-RPC (copy)
add_filter( ‘xmlrpc_enabled’, ‘__return_false’ );Continue reading
Site Title Anywhere
function site_title_shortcode() { return get_bloginfo(‘name’); } add_shortcode(‘sitetitle’, ‘site_title_shortcode’);Continue reading
Replace ‘Selection option’ with ‘Selection [Attribute]’ in Variation Select Dropdowns
add_filter(‘woocommerce_dropdown_variation_attribute_options_args’, function ($args) { // Make sure we have an attribute slug and (optionally) the product context. $attribute = isset($args[‘attribute’]) ? $args[‘attribute’] : ”; $product = isset($args[‘product’]) && $args[‘product’] instanceof WC_Product ? $args[‘product’] : null; if ($attribute) { // Get…Continue reading
Image gallery
// Get the current post ID $post_id = get_the_ID(); // Get the ACF field group data $tenon_cheeks_section = get_field(‘tenon_cheeks_section’, $post_id); // Check if the field has data if ($tenon_cheeks_section && is_array($tenon_cheeks_section)) { echo ‘ ‘; // Loop through each item…Continue reading
Vimeo ACF
if (get_field(‘video’)): ?>Continue reading
Envira CDN – Exclude a custom post type from using Envira CDN images
/** * Exclude my_news from using CDN, where my_news is the slug of custom post type. */ add_filter( ‘envira_cdn_should_process_content’, function( $should_process, $content ) { // Check if we’re on a single post/page and it’s my_news post type if ( is_singular(…Continue reading
Allow SVG Files Upload (copy)
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
Allow SVG Files Upload (copy)
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading