//This has been syncronised 123// function wp_remove_scripts() { // check if user is admina if (current_user_can( ‘update_core’ )) { return; } else { // Check for the page you want to target if ( is_page( ‘homepage’ ) ) { //…Continue reading
// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { // Check if user has the capability to delete products if ( !current_user_can( ‘delete_products’ ) ) { return; } $product…Continue reading
add_filter( ‘media_library_infinite_scrolling’, ‘__return_true’ );Continue reading
$post_url = urlencode( get_permalink() ); $post_title = urlencode( get_the_title() ); $facebook_url = “https://www.facebook.com/sharer/sharer.php?u=$post_url”; $x_url = “https://twitter.com/intent/tweet?url=$post_url&text=$post_title”; $linkedin_url = “https://www.linkedin.com/shareArticle?mini=true&url=$post_url&title=$post_title”; $social_buttons = ‘ ‘; echo $social_buttons; // Styles for the social sharing buttons. echo ‘ ‘;Continue reading
/** * Change a currency symbol */ add_filter(‘woocommerce_currency_symbol’, ‘change_existing_currency_symbol’, 10, 2); function change_existing_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case ‘AMD’: $currency_symbol = ‘֏’; break; } return $currency_symbol; }Continue reading
// Hide text using the shortcode like this: [spoiler]hidden text here[/spoiler]. add_shortcode(‘spoiler’, ‘inline_spoiler_shortcode’); function inline_spoiler_shortcode($atts, $content = null) { // Start output buffering ob_start(); // Output the spoiler content with the necessary styles ?> .inline-spoiler { color: transparent; background-color: #333;…Continue reading
function redirect_after_logout($redirect) { // error_log(‘[redirect_after_logout] Redirecting to: ‘ . home_url(‘store-login’)); return home_url(‘store-login’); } add_filter(‘wpmem_logout_redirect’, ‘redirect_after_logout’);Continue reading