Disable Embeds (copy)

/** * Disable all embeds in WordPress. */ add_action( ‘init’, function () { // Remove the REST API endpoint. remove_action( ‘rest_api_init’, ‘wp_oembed_register_route’ ); // Turn off oEmbed auto discovery. add_filter( ’embed_oembed_discover’, ‘__return_false’ ); // Don’t filter oEmbed results. remove_filter( ‘oembed_dataparse’,…Continue reading

Change TikTok purchase Event

add_filter(‘wpcode_pixel_event_name_tiktok’, function( $event_name, $event_key) { // Let’s send CompletePayment instead of PlaceAnOrder for purchase. if ( ‘purchase’ === $event_key ) { return ‘CompletePayment’; } return $event_name; }, 10, 2 );Continue reading

Change TikTok purchase Event

add_filter(‘wpcode_pixel_event_name_tiktok’, function( $event_name, $event_key) { if ( ‘purchase’ === $event_key ) { return ‘CompletePayment’; } return $event_name; }, 10, 2 );Continue reading

Add a dashboard widget to display users who have ‘News Feed’ enabled.

function custom_add_dashboard_widgets() { wp_add_dashboard_widget( ‘custom_news_feed_users_widget’, ‘News Feed Enabled Users’, ‘custom_display_news_feed_users’ ); } add_action(‘wp_dashboard_setup’, ‘custom_add_dashboard_widgets’); function custom_display_news_feed_users() { $user_query = new WP_User_Query(array( ‘meta_key’ => ‘iframe_toggle’, ‘meta_value’ => ‘1’ )); $users = $user_query->get_results(); $user_count = count($users); echo ‘ ‘; echo ‘ ‘;…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

Phone Number (depreciated)

$field_default = ‘default_phone’; // Set a default value for $field $source_default = ‘option’; // Set a default value for $option $output_default = ‘national’; // Set a default value for $output $field_custom = ‘custom_phone’; // Set a custom value for $field…Continue reading

Phone Number – Inline Text (depreciated)

$field_default = ‘default_phone’; // Set a default value for $field $source_default = ‘option’; // Set a default value for $option $title_value = ‘Click to call ‘ . get_bloginfo(‘name’) . ‘ now!’; // Check if there is a value for the…Continue reading

Change “Your Donation” On Donation Form

$fields = add_filter( ‘charitable_donation_form_fields’, ‘example_charitable_donation_form_fields’, 10, 2 ); function example_charitable_donation_form_fields( $fields, $form ) { $fields[‘donation_fields’][‘legend’] = ‘Changing This Title’; return $fields; }Continue reading

Disable Name Editing With Checkbox

// Add checkbox to user profile for administrators function add_custom_user_profile_field_3784163($user) { if (current_user_can(‘administrator’)) { // Display checkbox only for administrators $restrict_name_change = get_user_meta($user->ID, ‘restrict_name_change’, true); $checked = $restrict_name_change === ‘yes’ ? ‘checked’ : ”; ?>Continue reading