This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handles the bulk action. | |
*/ | |
function my_bulk_action_handler( $redirect_to, $action, $post_ids ) { | |
if ( $action !== 'draft_posts' ) { | |
return $redirect_to; | |
} | |
foreach ( $post_ids as $post_id ) { | |
wp_update_post( array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Shows a notice in the admin once the bulk action is completed. | |
*/ | |
function my_bulk_action_admin_notice() { | |
if ( ! empty( $_REQUEST['bulk_draft_posts'] ) ) { | |
$drafts_count = intval( $_REQUEST['bulk_draft_posts'] ); | |
printf( | |
'<div id="message" class="updated fade">' . | |
_n( '%s post moved to drafts.', '%s posts moved to drafts.', $drafts_count, 'domain' ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Prints the Breadcrumb in Storefront using the function by Yoast SEO. | |
*/ | |
function storefront_yoast_breadcrumb() { | |
if ( function_exists( 'yoast_breadcrumb' ) && ! is_home() ) { | |
yoast_breadcrumb( '<nav class="breadcrumbs">','</nav>' ); | |
} | |
} | |
add_action( 'storefront_content_top', 'storefront_yoast_breadcrumb' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.breadcrumbs { | |
background-color: #f8f8f8; | |
margin-left: -99em; | |
margin-right: -99em; | |
margin-bottom: 4.235801032em; | |
padding: 1.41575em 99em; | |
} | |
.breadcrumbs a { | |
color: #92969e; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Print a View Comment link in the comments list in the admin. | |
* | |
* @param array $actions | |
* @return array | |
*/ | |
function custom_view_comment_action( $actions ) { | |
global $comment; | |
if ( $comment->comment_type !== '' ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WC_Custom_My_Account_Tabs extends WC_Query { | |
/** | |
* Adds main filters and actions and inits the endpoints. | |
*/ | |
public function __construct() { | |
add_action( 'init', array( $this, 'add_endpoints' ) ); | |
if ( ! is_admin() ) { | |
add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 ); | |
add_filter( 'woocommerce_account_menu_items', array( $this, 'edit_navigation' ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WC_Custom_My_Account_Tabs extends WC_Query { | |
/** | |
* Adds main filters and actions and inits the endpoints. | |
*/ | |
public function __construct() { | |
add_action( 'init', array( $this, 'add_endpoints' ) ); | |
if ( ! is_admin() ) { | |
add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2><?php echo esc_html( 'Contact Us!' ); ?></h2> | |
<p><?php echo esc_html( 'Do you need any help? Please feel free to contact us from here!' ); ?></p> | |
<?php echo do_shortcode( 'WRITE HERE YOUR CONTACT FORM 7 SHORTCODE' ); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action( 'storefront_footer', 'storefront_handheld_footer_bar', 999 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get current user ID | |
$user_id = get_current_user_id(); | |
// Check if the user is member of the plan 'gold' | |
if ( wc_memberships_is_user_active_member( $user_id, 'gold' ) ) { | |
echo 'This is a special message only for Gold members!'; | |
} else { | |
echo 'I\'m sorry, you are not a gold member. There\'s nothing here for you!'; | |
} |