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
var acs_action = 'myprefix_autocompletesearch'; | |
$("#autosearch").autocomplete({ | |
source: function(req, response){ | |
$.getJSON(AUTOSEARCH.ajaxurl+'?callback=?&action='+acs_action, req, response); | |
}, | |
select: function(event, response) { | |
$('#added-posts').append( '<li id="' + response.item.id + '">' + response.item.label + '<i class="fa fa-pencil"></i><i class="fa fa-times"></i></li>' ); | |
$("#autosearch_posts").attr( "value", response.item.id ); | |
$(this).val(''); return false; | |
}, |
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 autosearch_metabox_callback() { | |
$output = '<div id="added-posts"><ul><input type="hidden" value=" " id="autosearch_posts" name="autosearch_posts" /></ul></div>'; | |
$output .= '<label for="autosearch" id="autosearch-label" >'; | |
$output .= '<input type="text" id="autosearch" name="autosearch" size="80" />'; | |
echo $output; | |
} | |
add_action( 'add_meta_boxes', 'wp_autosearch_add_metabox' ); |
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 | |
//If you only need to change one use this version. | |
function dwwp_change_title( $title_placeholder) { | |
$screen = get_current_screen(); | |
if ( $screen->post_type == 'job' ) { //<--Your post type name goes here. | |
$title_placeholder = 'I changed the title yo'; | |
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 dwwp_after_title_sudo_metabox() { | |
$screen = get_current_screen(); | |
$edit_post_type = $screen->post_type; | |
if ( 'job' != $edit_post_type ) { | |
return; | |
} | |
?> | |
<div class="after-title-help postbox"> |
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 my_contextual_help( $contextual_help, $screen_id, $screen ) { | |
if ( 'job' == $screen->id ) { | |
$contextual_help = '<h2>Products</h2> | |
<p>Products show the details of the items that we sell on the website. You can see a list of them on this page in reverse chronological order - the latest one we added is first.</p> | |
<p>You can view/edit the details of each product by clicking on its name, or you can perform bulk actions using the dropdown menu and selecting multiple items.</p>'; | |
} elseif ( 'edit-product' == $screen->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
<?php | |
function gmwm_move_featured_image() { | |
remove_meta_box( 'postimagediv', 'metabox', 'side' ); | |
add_meta_box('featured_image', 'Add Featured Image', 'post_thumbnail_meta_box', 'metabox', 'normal', 'high'); | |
} | |
add_action( 'do_meta_boxes', 'gmwm_move_featured_image' ); |
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 dwwp_admin_enqueue_scripts() { | |
//These varibales allow us to target the post type and the post edit screen. | |
global $pagenow, $typenow; | |
if ( ($pagenow == 'post.php' || $pagenow == 'post-new.php') && $typenow == 'job' ) { | |
//Plugin Main CSS File. | |
wp_enqueue_style( 'dwwp-admin-css', plugins_url( 'css/admin-jobs.css', __FILE__ ) ); | |
//Plugin Main js File. |
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 bootstrap_bob_user_image($user) { | |
?> | |
<h3>User Profile Picture</h3> | |
<table> | |
<tr> | |
<th><label for="upload_image">Enter a URL or upload an image.</label></th> | |
<td><input id="upload_image" type="text" size="36" name="ad_image" value="<?php if ( !empty( get_the_author_meta( 'upload_image', $user->ID ) ) ) echo esc_attr(get_the_author_meta( 'upload_image', $user->ID )); ?>" /></td> |
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(document).ready(function($){ | |
var custom_uploader; | |
$('#upload_image_button').click(function(e) { | |
e.preventDefault(); | |
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 agency_wp_test() { | |
$post_types = get_post_types(); | |
foreach ( $post_types as $post_type ) { | |
$taxonomy_names = get_object_taxonomies( $post_type ); | |
$terms = get_terms( $taxonomy_names, array( 'hide_empty' => false )); | |
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ | |
echo '<h5>'.$post_type.'</h5>'; |
OlderNewer