Example #1
0
function create_social_hashtag_posttype()
{
    if (empty($social_hashtag_cache)) {
        $social_hashtag_cache = new SOCIAL_HASHTAG_CACHE();
    }
    $global_options = $social_hashtag_cache->get_social_hashtag_options(null, 'global');
    $slug = !empty($global_options['slug']) ? $global_options['slug'] : $social_hashtag_cache->cpt_slug;
    register_post_type('social_hashtag', array('labels' => array('name' => __('Social Hashtags'), 'singular_name' => __('Social Hashtag'), 'edit_item' => __('Edit Social Hashtag'), 'view_item' => __('View Social Hashtag'), 'search_items' => __('Search Social Hashtags'), 'not_found' => __('No social Hashtags found'), 'not_found_in_trash' => __('No social hashtag found in trash')), 'public' => true, 'supports' => array('title', 'thumbnail', 'editor', 'custom-fields'), 'capability_type' => 'post', 'has_archive' => $slug, 'hierarchical' => false, 'taxonomies' => array('social_hashtag_categories', 'social_hashtag_tags'), 'rewrite' => array('slug' => $slug), 'menu_position' => '5'));
    register_taxonomy('social_hashtag_categories', 'social_hashtag', array('labels' => array('name' => 'Social Hashtag Categories', 'singular_name' => 'Social Hashtag Categories', 'search_items' => 'Search Social Hashtag Categories', 'popular_items' => 'Popular Social Hashtag Categories', 'all_items' => 'All Social Hashtag Categories', 'parent_item' => 'Parent Social Hashtag Categories', 'parent_item_colon' => 'Parent Social Hashtag Categories:', 'edit_item' => 'Edit Social Hashtag Category', 'update_item' => 'Update Social Hashtag Category', 'add_new_item' => 'Add New Social Hashtag Category', 'new_item_name' => 'New Social Hashtag Category Name'), 'hierarchical' => true, 'label' => 'Social Hashtag Category', 'show_ui' => true, 'rewrite' => array('slug' => $slug . '-categories')));
    register_taxonomy('social_hashtag_tags', 'social_hashtag', array('labels' => array('name' => 'Social Hashtag Tags', 'singular_name' => 'Social Hashtag Tags', 'search_items' => 'Search Social Hashtag Tags', 'popular_items' => 'Popular Social Hashtag Tags', 'all_items' => 'All Social Hashtag Tags', 'parent_item' => 'Parent Social Hashtag Tags', 'parent_item_colon' => 'Parent Social Hashtag Tags:', 'edit_item' => 'Edit Social Hashtag Tag', 'update_item' => 'Update Social Hashtag Tag', 'add_new_item' => 'Add New Social Hashtag Tag', 'new_item_name' => 'New Social Hashtag Tag Name'), 'hierarchical' => false, 'label' => 'Social Hashtag Tag', 'show_ui' => true, 'update_count_callback' => '_update_post_term_count', 'rewrite' => array('slug' => $slug . '-tags')));
}
function social_hashtag_run_request()
{
    social_hashtag_logging('Start - run manually', 2);
    $social_hashtag_cache = new SOCIAL_HASHTAG_CACHE();
    if (!empty($_REQUEST['debug'])) {
        $social_hashtag_cache->debug = true;
    }
    $results = $social_hashtag_cache->run_social_hashtag_query($_REQUEST['num']);
    print json_encode(array('success' => true, 'message' => $results));
    social_hashtag_logging('End - run manually: ' . $results, 2);
    die;
}