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 | |
/** | |
* This is the entire callback function for the metabox. You can copy the whole thing or just the fields. | |
*/ | |
function dwwp_meta_callback() { | |
?> | |
<div> |
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_meta_save( $post_id ) { | |
// Checks save status | |
$is_autosave = wp_is_post_autosave( $post_id ); | |
$is_revision = wp_is_post_revision( $post_id ); | |
$is_valid_nonce = ( isset( $_POST[ 'dwwp_jobs_nonce' ] ) && wp_verify_nonce( $_POST[ 'dwwp_jobs_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false'; | |
// Exits script depending on save status | |
if ( $is_autosave || $is_revision || !$is_valid_nonce ) { | |
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 | |
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 dwwp_add_submenu_page() { | |
add_submenu_page( | |
'edit.php?post_type=job', | |
'Reorder Jobs', | |
'Reorder Jobs', | |
'manage_options', | |
'reorder_jobs', |
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>'; |