This file contains 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 | |
// Do [download_history] heading | |
add_action( 'edd_before_download_history', 'richr_do_download_history_before' ); | |
function richr_do_download_history_before() { | |
echo '<h2>Download your files</h2>'; | |
} | |
// Do [purchase_history] heading | |
add_action( 'edd_purchase_history_header_before', 'richr_do_purchase_history_before' ); |
This file contains 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 | |
//* Change Display Posts Shortcode plugin title wrap from h2 to h4 | |
add_filter( 'display_posts_shortcode_title_tag', 'richr_do_display_posts_shortcode_title_wrap' ); | |
function richr_do_display_posts_shortcode_title_wrap($title_wrap) { | |
$title_wrap = 'h4'; | |
return $title_wrap; | |
} |
This file contains 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 | |
function change_author_capabilities() { | |
$role = get_role( 'author' ) ; | |
$role->remove_cap( 'edit_published_posts' ); | |
$role->remove_cap( 'publish_posts' ); | |
$role->remove_cap( 'delete_published_posts' ); | |
$role->remove_cap( 'edit_posts' ); | |
$role->remove_cap( 'delete_posts' ); |
This file contains 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 | |
function change_post_label() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'News'; | |
$submenu['edit.php'][5][0] = 'News'; | |
$submenu['edit.php'][10][0] = 'Add News'; | |
$submenu['edit.php'][16][0] = 'News Tags'; |
This file contains 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 | |
function change_author_capabilities() { | |
$role = get_role( 'shop_vendor' ) ; | |
$role->add_cap( 'delete_published_products' ); | |
} | |
add_action( 'admin_init', 'change_author_capabilities' ); |
This file contains 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 | |
//* Add custom admin body class to the head | |
add_filter( 'admin_body_class', 'beats_admin_body_class' ); | |
function beats_admin_body_class( $classes ) { | |
$classes .= 'beatminded'; | |
return $classes; | |
} |
This file contains 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
/** | |
* Preset a download to variable pricing on post creation/save | |
* | |
* @since 1.0 | |
*/ | |
add_action( 'save_post', 'beats_preset_variable_pricing', 20, 2 ); | |
function beats_preset_variable_pricing( $post_id ) { | |
// If this isn't a 'download' post, don't update it. | |
if( 'download' !== get_post_type() ) { | |
return; |
This file contains 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 | |
//* Add class to .content | |
add_filter( 'genesis_attr_content', 'beatm_facetwp_class' ); | |
function beatm_facetwp_class( $attributes ) { | |
$attributes['class'] = $attributes['class']. ' facetwp-template'; | |
return $attributes; | |
} |
This file contains 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 | |
add_action( 'tgmsp_before_slider_output', 'tgm_custom_slider_theme' ); | |
function tgm_custom_slider_of_madness( $id ) { | |
// If not the proper slider ID, do nothing. Change to match your slider ID. | |
if ( '324' !== $id ) return; | |
// Dequeue the default styles. | |
wp_dequeue_style( 'soliloquy-style' ); | |
This file contains 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
/* =BEGIN: Check If Page Is Child | |
Source: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/ | |
---------------------------------------------------------------------------------------------------- */ | |
function is_child( $page_id_or_slug ) { // $page_id_or_slug = The ID of the page we're looking for pages underneath | |
global $post; // load details about this page | |
if ( !is_numeric( $page_id_or_slug ) ) { // Used this code to change a slug to an ID, but had to change is_int to is_numeric for it to work. | |
$page = get_page_by_path( $page_id_or_slug ); | |
$page_id_or_slug = $page->ID; | |
} |
OlderNewer