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
jQuery('#s').suggest(ajax.url + '?action=tdp_ajax_search_query'); |
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
// Use minified libraries if SCRIPT_DEBUG is turned off | |
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
wp_enqueue_script( 'my-script-handle', plugin_dir_url( __FILE__ ) . 'assets/my-file' . $suffix . '.js', array( 'jquery' ) ); |
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
add_filter( 'admin_comment_types_dropdown', 'tdp_admin_comment_types_dropdown' ); | |
function tdp_admin_comment_types_dropdown( $types ) { | |
//replace parts as needed | |
$types['your_note_type'] = __( 'Your Note Type', 'your-text-domain' ); | |
return $types; | |
} |
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
/** | |
* Filter Menu Items | |
*/ | |
function tdp_filter_menu_items( $items, $args ) { | |
if($args->theme_location == 'primary_menu') | |
{ | |
$items .= '<li class="primary-menu-secondary-item"><a href="#">Menu Item</a></li>'; | |
} |
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
function tdp_remove_script_version( $src ){ | |
return remove_query_arg( 'ver', $src ); | |
} | |
add_filter( 'script_loader_src', 'tdp_remove_script_version' ); | |
add_filter( 'style_loader_src', 'tdp_remove_script_version' ); |
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
add_action('save_post', 'wdb_check_thumbnail'); | |
add_action('admin_notices', 'wdb_thumbnail_error'); | |
function wdb_check_thumbnail($post_id) { | |
// convert to a custom post type | |
if(get_post_type($post_id) != 'post') | |
return; | |
if ( !has_post_thumbnail( $post_id ) ) { |
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
/** | |
* Display All items within the menu. | |
* | |
* @return $args | |
*/ | |
function wprm_show_all_items($args) { | |
$args['posts_per_page'] = -1; | |
return $args; |
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
function wprm_show_calendar_to_managers() { | |
return 'publish_wprm_reservations'; | |
} | |
add_filter( 'wprm_calendar_cap', 'wprm_show_calendar_to_managers' ); |
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
add_filter('wp_dropdown_users', 'tdp_custom_wp_dropdown_users'); | |
function tdp_custom_wp_dropdown_users($output) { | |
global $post; | |
$users = get_users(); | |
$output = "<select id=\"post_author_override\" name=\"post_author_override\" class=\"\">"; | |
$output .= "<option value=\"1\">Admin</option>"; | |
foreach($users as $user) { | |
$sel = ($post->post_author == $user->ID)?"selected='selected'":''; | |
$output .= '<option value="'.$user->ID.'"'.$sel.'>'.$user->user_login.'</option>'; | |
} |
OlderNewer