private function __construct()
 {
     add_action('wp_ajax_get_select_cpt', array($this, 'get_select_cpt'));
     add_action('wp_ajax_get_groups', array($this, 'get_groups'));
     add_action('wp_ajax_get_forums', array($this, 'get_forums'));
     add_action('wp_ajax_create_group', array($this, 'create_group'));
     add_action('wp_ajax_create_forum', array($this, 'create_forum'));
     add_action('wp_ajax_get_permalink', array($this, 'get_permalink'));
     /* ===== Save Course ===*/
     add_action('wp_ajax_new_create_course', array($this, 'create_course'));
     add_action('wp_ajax_new_save_course', array($this, 'save_course'));
     add_action('wp_ajax_new_save_course_settings', array($this, 'save_course_settings'));
     add_action('wp_ajax_new_save_course_components', array($this, 'save_course_components'));
     add_action('wp_ajax_preview_element', array($this, 'preview_element'));
     add_action('wp_ajax_get_element', array($this, 'get_element'));
     add_Action('wp_ajax_save_element', array($this, 'save_element'));
     add_action('wp_ajax_delete_element', array($this, 'delete_element'));
     add_action('wp_ajax_preview_question_element', array($this, 'preview_sub_element'));
     add_action('wp_ajax_get_question_element', array($this, 'get_sub_element'));
     add_action('wp_ajax_create_new_question', array($this, 'create_new_question'));
     add_action('wp_ajax_create_new_curriculum', array($this, 'create_new_curriculum'));
     add_action('wp_ajax_save_course_curriculum', array($this, 'save_course_curriculum'));
     add_action('wp_ajax_preview_sub_element', array($this, 'preview_sub_element'));
     add_action('wp_ajax_get_sub_element', array($this, 'get_sub_element'));
     add_action('wp_ajax_create_new_assignment', array($this, 'create_new_curriculum'));
     add_action('wp_ajax_create_new_product', array($this, 'create_new_product'));
     add_action('wp_ajax_set_product', array($this, 'set_product'));
     add_action('wp_ajax_new_save_pricing', array($this, 'new_save_pricing'));
 }
 public function __construct()
 {
     //add our foogallery metaboxes
     add_action('add_meta_boxes', array($this, 'add_meta_boxes_to_gallery'));
     //save extra post data for a gallery
     add_action('save_post', array($this, 'save_gallery'));
     //save custom field on a page or post
     add_Action('save_post', array($this, 'attach_gallery_to_post'), 10, 2);
     //whitelist metaboxes for our gallery postype
     add_filter('foogallery_metabox_sanity', array($this, 'whitelist_metaboxes'));
     //add scripts used by metaboxes
     add_action('admin_enqueue_scripts', array($this, 'include_required_scripts'));
     // Ajax calls for creating a page for the gallery
     add_action('wp_ajax_foogallery_create_gallery_page', array($this, 'ajax_create_gallery_page'));
 }
Ejemplo n.º 3
0
 private function __construct()
 {
     add_action('wp_ajax_get_admin_select_cpt', array($this, 'get_admin_select_cpt'));
     add_Action('wp_ajax_get_groups', array($this, 'get_groups'));
 }
Ejemplo n.º 4
0
<?php

add_action("admin_init", array("dsSearchAgent_Admin", "Initialize"));
add_Action("admin_enqueue_scripts", array("dsSearchAgent_Admin", "Enqueue"));
add_action("admin_menu", array("dsSearchAgent_Admin", "AddMenu"), 40);
add_action("admin_notices", array("dsSearchAgent_Admin", "DisplayAdminNotices"));
add_action("wp_ajax_dsidxpress-dismiss-notification", array("dsSearchAgent_Admin", "DismissNotification"));
add_filter("manage_nav-menus_columns", array("dsSearchAgent_Admin", "CreateLinkBuilderMenuWidget"), 9);
add_action("admin_print_scripts", array("dsSearchAgent_Admin", "SetPluginUri"));
if (defined('ZPRESS_API') && ZPRESS_API != '') {
    add_filter('nav_menu_items_zpress-page', array('dsSearchAgent_Admin', 'NavMenus'));
}
class dsSearchAgent_Admin
{
    static $HeaderLoaded = null;
    static $capabilities = array();
    static function AddMenu()
    {
        $options = get_option(DSIDXPRESS_OPTION_NAME);
        dsSearchAgent_Admin::GenerateAdminMenus(DSIDXPRESS_PLUGIN_URL . 'assets/idxpress_LOGOicon.png');
        dsSearchAgent_Admin::GenerateAdminSubMenus();
        add_filter("mce_external_plugins", array("dsSearchAgent_Admin", "AddTinyMcePlugin"));
        add_filter("mce_buttons", array("dsSearchAgent_Admin", "RegisterTinyMceButton"));
        // won't work until this <http://core.trac.wordpress.org/ticket/12207> is fixed
        //add_filter("tiny_mce_before_init", array("dsSearchAgent_Admin", "ModifyTinyMceSettings"));
    }
    static function GenerateAdminMenus($icon_url)
    {
        add_menu_page('IDX', 'IDX', "manage_options", "dsidxpress", "", $icon_url);
        $activationPage = add_submenu_page("dsidxpress", "IDX Activation", "Activation", "manage_options", "dsidxpress", array("dsSearchAgent_Admin", "Activation"));
        add_action("admin_print_scripts-{$activationPage}", array("dsSearchAgent_Admin", "LoadHeader"));
Ejemplo n.º 5
0
function ebd_setup_sidebar()
{
    // display custom post types 'photos', 'videos' and 'notes' in recent posts widget
    function wcs_cpt_recent_posts_widget($params)
    {
        $params['post_type'] = array('portfolio', 'blog');
        return $params;
    }
    add_filter('widget_posts_args', 'wcs_cpt_recent_posts_widget');
    $widget_area = array(array('name' => __('Recent News Area', 'ebd'), 'id' => 'recent-widget-area'), array('name' => __('Footer Text Area', 'ebd'), 'id' => 'footer-widget-area'), array('name' => __('popular posts Area', 'ebd'), 'id' => 'popular-widget-area'), array('name' => __('Twitter Feed', 'ebd'), 'id' => 'Twitter-widget-area'), array('name' => __('Homepage Text Area', 'ebd'), 'id' => 'Homepage-widget-area'), array('name' => __('mail chimp', 'ebd'), 'id' => 'mail-widget-area'));
    foreach ($widget_area as $area) {
        $args = array('name' => $area['name'], 'id' => $area['id'], 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h3 class="upper widget-head">', 'after_title' => '</h3>');
        register_sidebar($args);
    }
}
add_Action('widgets_init', 'ebd_setup_sidebar');
//------ Sets the post excerpt length ------//
function ebd_excerpt_length($length)
{
    if (get_post_type() === 'blog') {
        return 30;
        // Number of words
    } else {
        return 60;
        // Number of words
    }
}
add_filter('excerpt_length', 'ebd_excerpt_length');
//----- Replaces "[...]" with just "..." ------//
add_filter('excerpt_more', 'ebd_excerpt_more');
function ebd_excerpt_more($more)
<?php

add_action('the_content', 'wl_process_content');
function wl_process_content($content)
{
    global $post;
    if (get_post_type($post->ID) == 'quiz') {
        $content = wbq_generate_quiz($post->ID);
    }
    return $content;
}
add_Action('wp_head', 'filter_head');
function filter_head()
{
    $config = get_option('wst_options');
    echo '<meta property="fb:app_id" content="' . $config['fb_api'] . '" />';
}
// removing default non used functionality
add_filter('post_row_actions', 'remove_row_actions', 10, 2);
function remove_row_actions($actions, $post)
{
    global $current_screen;
    if ($current_screen->post_type != 'new_quiz') {
        return $actions;
    }
    unset($actions['edit']);
    unset($actions['inline hide-if-no-js']);
    return $actions;
}
Ejemplo n.º 7
0
    if (has_template('single-klagebrev')) {
        // Conditional script(s)
        wp_register_script('get-action', get_template_directory_uri() . '/js/form-generate.js', array('jquery'), '1.0.0');
        wp_enqueue_script('get-action');
    }
}
/* Change menu item names in Admin */
function edit_admin_menu()
{
    global $menu;
    global $submenu;
    $menu[5][0] = 'Innlegg';
    $submenu['edit.php'][5][0] = 'Alle innlegg';
    $menu[20][0] = 'Faste sider';
}
add_Action('admin_menu', 'edit_admin_menu');
// CUSTOMIZE ADMIN MENU ORDER
function custom_menu_order($menu_ord)
{
    if (!$menu_ord) {
        return true;
    }
    return array('index.php', 'edit.php?post_type=page', 'edit.php', 'edit.php?post_type=events', 'edit-comments.php', 'upload.php', 'edit.php?post_type=pressemelding');
}
add_filter('custom_menu_order', 'custom_menu_order');
add_filter('menu_order', 'custom_menu_order');
/*-----------------------------------------------------------------------------------*/
/*  Custom logos
/*-----------------------------------------------------------------------------------*/
function custom_admin_logo()
{
Ejemplo n.º 8
0
                                        </div>
                                        <div class="clear"></div>
                                    </form>
                                    <div class="clear"></div>
                                </div>
                            <?php 
    }
    ?>


                        </div>
                        <!-- Theme Option Fields for section # Ends -->
                    </div>
                </div>
                <script>jQuery('.ttip').tooltip({placement:'right',animation:false, container:'ul.nav-pills'}); jQuery('.nav-pills a').click(function(e){e.preventDefault(); jQuery('.nav-tabs li').slideUp();jQuery(jQuery(this).attr('rel')).slideDown(); });</script>
            </div>
        </div>

    </div>
<?php 
}
function sensitive_admin_enqueue_scripts()
{
    wp_enqueue_style("thickbox");
    wp_enqueue_script("thickbox");
}
add_action("admin_enqueue_scripts", "sensitive_admin_enqueue_scripts");
add_action('admin_menu', 'sensitive_theme_opt_menu');
add_Action('wp_head', 'sensitive_custom_css');
Ejemplo n.º 9
0
        return get_template_directory_uri() . '/images/featured-post-no-image.jpg';
    }
}
/*
 * show only posts in default search
 */
function tabbysplace_search_filter($query)
{
    if (!is_admin() && $query->is_main_query()) {
        if ($query->is_search) {
            $query->set('post_type', 'post');
        }
    }
}
add_action('pre_get_posts', 'tabbysplace_search_filter');
add_Action('dynamic_sidebar', 'tabby_dynamic_sidebar', 10, 1);
function tabby_dynamic_sidebar($widget)
{
    if ($widget['id'] == 'featured_post_widget-2') {
        echo '<div class="blog-widgets-combined">';
    }
    if ($widget['id'] == 'jal_widget-2') {
        echo '</div>';
    }
}
function deploy($var)
{
    echo '<pre>';
    var_dump($var);
    echo '</pre>';
    die;
Ejemplo n.º 10
0
 * @return void
 */
function marksale()
{
    $marksaleTrackingId = get_option('marksaleTrackingId');
    if (!empty($marksaleTrackingId)) {
        echo '<!--noptimize--><script type="text/javascript">var _mstc = {}; _mstc.id = "' . $marksaleTrackingId . '"; _mstc.endpoint = "https://tracking.weiseundstark.de/api/";</script><script src="https://tracking.weiseundstark.de/tracker.js"></script><!--/noptimize-->';
    }
}
/**
 * Method to include the mainSettings page
 *
 * @return void
 */
function marksale_admin_settings()
{
    require_once "marksale_admin.php";
}
/**
 * Method to create the Marksale Menu on the options Page
 *
 * @return void
 */
function marksale_menu()
{
    add_options_page('Marksale', 'Marksale', 'administrator', 'marksale', 'marksale_admin_settings');
}
if (is_admin()) {
    add_Action('admin_menu', 'marksale_menu');
}
add_action('wp_footer', 'marksale');