Archives: Snippets
HubSpot tracking code
Сортировка методов доставки СДЭК по стоимости, от дешевых к дорогим
/** * Sorting SDEK shipping methods by cost, from cheap to expensive * * @param array $rates Array of shipping methods * * @return array */ add_filter( ‘woocommerce_package_rates’, function( $rates ) { if( empty( $rates ) || ! is_array( $rates…Continue reading
MemberPress: Free-Views-Used Counter
function mepr_display_cookie() { $free_views = isset( $_COOKIE[‘mp3pi141592pw’]) ? base64_decode( $_COOKIE[‘mp3pi141592pw’] ) : false; if( $free_views !== false ) { echo ‘You used ‘ . $free_views . ‘ free views!’; } } add_action( ‘init’, ‘mepr_display_cookie’ );Continue reading
MemberPress: Disable the Default WordPress Password Reset Link E-Mail
function mepr_disable_password_reset_email( $recipients, $subject, $message, $headers ) { $set_password_notification_subject = MeprHooks::apply_filters( ‘mepr_set_new_password_title’, sprintf( __( “[%s] Set Your New Password”, ‘memberpress’ ), MeprUtils::blogname() ) ); if ( $subject == $set_password_notification_subject ) { $recipients = array(); } return $recipients; } add_filter( ‘mepr-wp-mail-recipients’,…Continue reading
Output og:image that uses the Large Size Image
add_filter( ‘aioseo_thumbnail_size’, function( $imageSize ) { return ‘large’; } );Continue reading
Back to Top Button (copy)
Display both published and modified date
Hide All Admin Notices in Sidebar
// Hide all admin notices in a collapsible sidebar function hide_all_admin_notices_in_sidebar() { ?>Continue reading
Remove the author of an article
add_filter( ‘aioseo_schema_output’, ‘aioseo_filter_schema_output’ ); function aioseo_filter_schema_output( $graphs ) { if ( is_singular( ‘post’ ) ) { foreach ( $graphs as $index => $graph ) { if ( ‘Article’ === $graph[‘@type’] ) { unset( $graphs[ $index ][‘author’] ); } if (…Continue reading