Type: php
WP Simple Pay: Facebook Payment Conversion Tracking
/** * @link https://library.wpcode.com/snippet/j57gg315/ */ add_action( ‘simpay_payment_receipt_viewed’, /** * Runs the first time the payment confirmation page is viewed. * * @param array $payment_confirmation_data */ function( $payment_confirmation_data ) { // Payment customer data (not used in this example). $customer =…Continue reading
Fluid_calc
// Function to add the calculator to the admin menu function ft_calculator_admin_menu() { add_menu_page( “Fluid Typography Calculator”, // Page title “Typography Calculator”, // Menu title “manage_options”, // Capability “fluid-typography-calculator”, // Menu slug “ft_calculator_page” // Function that displays the page content…Continue reading
WP Simple Pay: Add User Meta After Payment
/** * @link https://library.wpcode.com/snippet/qo9xxmjo/ * * @param \Stripe\Event $event Stripe Event. * @param \Stripe\Subscription|\Stripe\PaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_update_wp_user( $event, $object ) { $email_address = $object->customer->email; $wp_user = get_user_by( ’email’, $email_address ); // User cannot be found,…Continue reading
google search console
Display Featured Image in Post List (copy)
/* Source: https://rudrastyh.com/wordpress/quick-edit-featured-image.html */ add_filter(‘manage_post_posts_columns’, ‘misha_featured_image_column’); function misha_featured_image_column( $column_array ) { // I want to add my column at the beginning, so I use array_slice() // in other cases $column_array[‘featured_image’] = ‘Featured Image’ will be enough $column_array = array_slice( $column_array,…Continue reading
Google dSense Snippet
google.com, pub-9217976203305712, DIRECT, f08c47fec0942fa0Continue 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
Set Header Menu as “Custom”
add_filter( ‘totaltheme/header/menu/is_custom’, ‘__return_true’ );Continue reading
Add Rel Nofollow to Top Bar Social Links
add_filter( ‘totaltheme/topbar/social/link_attributes’, function( $attrs ) { $attrs[‘rel’] = ‘nofollow’; return $attrs; } );Continue reading