/**
 * Admin scripts loader.
 *
 * @since 1.0.0
 * @package GeoDirectory
 * @global string $pagenow The current screen.
 */
function geodir_conditional_admin_script_load()
{
    global $pagenow;
    // Get the current post type
    $post_type = geodir_admin_current_post_type();
    $geodir_post_types = geodir_get_posttypes();
    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory' || ($pagenow == 'post.php' || $pagenow == 'post-new.php' || $pagenow == 'edit.php') && $post_type && in_array($post_type, $geodir_post_types) || ($pagenow == 'edit-tags.php' || $pagenow == 'edit-comments.php' || $pagenow == 'comment.php')) {
        add_action('admin_enqueue_scripts', 'geodir_admin_scripts');
        add_action('admin_enqueue_scripts', 'geodir_admin_styles');
    }
    add_action('admin_enqueue_scripts', 'geodir_admin_styles_req');
}
예제 #2
0
/**
 * Filter post type columns in backend listing.
 *
 * @since 1.1.6
 *
 * @param string $columns Array of post type columns.
 * @param string Array of post type columns.
 */
function geodir_cpt_edit_post_columns($columns)
{
    if (!empty($columns) && isset($columns['location']) && ($post_type = geodir_admin_current_post_type())) {
        if (geodir_cpt_no_location($post_type)) {
            unset($columns['location']);
        }
    }
    return $columns;
}