Changing Text For Suggestion Donation Descriptions

add_filter( ‘charitable_campaign_suggested_donations’, ‘example_charitable_campaign_suggested_donations’, 10, 2 ); function example_charitable_campaign_suggested_donations( $value = array(), $campaign_object ) { if ( empty( $value ) ) { return; } /* $value is an array of suggested donations. It often looks like this by default: Array (…Continue reading

Untitled Snippet

@ini_set( ‘upload_max_size’ , ‘256M’ ); @ini_set( ‘post_max_size’, ‘256M’); @ini_set( ‘max_execution_time’, ‘300’ );Continue reading

Yoast SEO (copy)

// Change OG title for Yoast on Vendor Pages function wcv_wpseo_change_og_title( $title ) { if ( WCV_Vendors::is_vendor_page() ) { $vendor_shop = urldecode( get_query_var( ‘vendor_shop’ ) ); $vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); $shop_title = get_user_meta( $vendor_id, ‘pv_shop_name’, true ); $og_title =…Continue reading

Allow Upload Fonts

function custom_upload_mimes($existing_mimes) { // Hinzufügen oder Ändern von Dateitypen $existing_mimes[‘svg’] = ‘image/svg+xml’; $existing_mimes[‘woff’] = ‘application/font-woff’; $existing_mimes[‘woff2’] = ‘application/font-woff2’; $existing_mimes[‘eot’] = ‘application/vnd.ms-fontobject’; $existing_mimes[‘ttf’] = ‘application/x-font-ttf’; // Entfernen von Dateitypen unset( $existing_mimes[‘exe’] ); return $existing_mimes; } add_filter(‘upload_mimes’, ‘custom_upload_mimes’);Continue reading

Blocks on templates

/** * Setting Hero Block on Pages by default. * */ function awesome_register_page_template() { $post_type_object = get_post_type_object( ‘page’ ); $post_type_object->template = array( array( ‘core/pattern’, array( ‘slug’ => ‘frost/hero’, ) ), ); } add_action( ‘init’, ‘awesome_register_page_template’ );Continue reading

PHP [Vendor/Post Relationships > Work in Progress]: Dynamic Population of ACF Fields Using REST API

function my_acf_enqueue_scripts() { wp_enqueue_script(‘my-acf-dynamic-fields’, get_stylesheet_directory_uri() . ‘/js/acf-dynamic-fields.js’, array(‘acf-input’), null, true); wp_localize_script(‘my-acf-dynamic-fields’, ‘wpApiSettings’, array( ‘nonce’ => wp_create_nonce(‘wp_rest’), // Provide nonce for secure AJAX calls )); } add_action(‘acf/input/admin_enqueue_scripts’, ‘my_acf_enqueue_scripts’); // add_action(‘save_post’, ‘save_dynamic_acf_fields’, 10, 3); // function save_dynamic_acf_fields($post_id, $post, $update) { // //…Continue reading