Example #1
0
function hocwp_get_all_sb_shortcodes()
{
    $shortcodes = hocwp_get_all_shortcodes();
    $result = array();
    foreach ($shortcodes as $key => $function) {
        if ('sb' == substr($key, 0, 2) && 'sb' == substr($function, 0, 2) || 'hocwp' == substr($key, 0, 5) && 'hocwp' == substr($function, 0, 5)) {
            $result[$key] = $function;
        }
    }
    return $result;
}
Example #2
0
function hocwp_default_script_localize_object()
{
    $datepicker_icon = apply_filters('hocwp_datepicker_icon', HOCWP_URL . '/images/icon-datepicker-calendar.gif');
    $shortcodes = hocwp_get_all_shortcodes();
    $args = array('ajax_url' => admin_url('admin-ajax.php'), 'security' => wp_create_nonce('hocwp_nonce'), 'datepicker_icon' => $datepicker_icon, 'shortcodes' => $shortcodes, 'logged_in' => hocwp_bool_to_int(is_user_logged_in()), 'i18n' => array('jquery_undefined_error' => __('HocWP\'s JavaScript requires jQuery', 'hocwp-theme'), 'jquery_version_error' => sprintf(__('HocWP\'s JavaScript requires jQuery version %s or higher', 'hocwp-theme'), HOCWP_MINIMUM_JQUERY_VERSION), 'insert_media_title' => __('Insert media', 'hocwp-theme'), 'insert_media_button_text' => __('Use this media', 'hocwp-theme'), 'insert_media_button_texts' => __('Use these medias', 'hocwp-theme'), 'confirm_message' => __('Are you sure?', 'hocwp-theme'), 'disconnect_confirm_message' => __('Are you sure you want to disconnect?', 'hocwp-theme'), 'delete_confirm_message' => __('Are you sure you want to delete this?', 'hocwp-theme'), 'processing_text' => __('Processing...', 'hocwp-theme'), 'max_file_item_select_error' => __('You can not select more than %s files.', 'hocwp-theme')), 'ajax_loading' => '<p class="ajax-wrap"><img class="ajax-loading" src="' . hocwp_get_image_url('icon-loading-circle-light-full.gif') . '" alt=""></p>');
    return apply_filters('hocwp_default_script_object', $args);
}