Beispiel #1
0
/**
 * Admin action for handling fetching the style fields
 */
function siteorigin_panels_ajax_action_style_form()
{
    $type = $_REQUEST['type'];
    if (!in_array($type, array('row', 'widget'))) {
        exit;
    }
    $current = isset($_REQUEST['style']) ? $_REQUEST['style'] : array();
    switch ($type) {
        case 'row':
            siteorigin_panels_render_styles_fields('row', '<h3>' . __('Row Styles', 'siteorigin-panels') . '</h3>', '', $current);
            break;
        case 'widget':
            siteorigin_panels_render_styles_fields('widget', '<h3>' . __('Widget Styles', 'siteorigin-panels') . '</h3>', '', $current);
    }
    exit;
}
Beispiel #2
0
/**
 * Admin action for handling fetching the style fields
 */
function siteorigin_panels_ajax_action_style_form()
{
    $type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING);
    if (!in_array($type, array('row', 'widget'))) {
        wp_die();
    }
    $current = filter_input(INPUT_POST, 'style', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY);
    $post_id = filter_input(INPUT_POST, 'postId', FILTER_SANITIZE_NUMBER_INT);
    switch ($type) {
        case 'row':
            siteorigin_panels_render_styles_fields('row', '<h3>' . __('Row Styles', 'siteorigin-panels') . '</h3>', '', $current, $post_id);
            break;
        case 'widget':
            siteorigin_panels_render_styles_fields('widget', '<h3>' . __('Widget Styles', 'siteorigin-panels') . '</h3>', '', $current, $post_id);
    }
    wp_die();
}
Beispiel #3
0
/**
 * Admin action for handling fetching the style fields
 */
function siteorigin_panels_ajax_action_style_form()
{
    $type = $_REQUEST['type'];
    if (!in_array($type, array('row', 'widget'))) {
        exit;
    }
    $current = isset($_REQUEST['style']) ? $_REQUEST['style'] : array();
    $post_id = empty($_REQUEST['postId']) ? 0 : $_REQUEST['postId'];
    $args = !empty($_POST['args']) ? json_decode($_POST['args'], true) : array();
    switch ($type) {
        case 'row':
            siteorigin_panels_render_styles_fields('row', '<h3>' . __('Row Styles', 'siteorigin-panels') . '</h3>', '', $current, $post_id, $args);
            break;
        case 'widget':
            siteorigin_panels_render_styles_fields('widget', '<h3>' . __('Widget Styles', 'siteorigin-panels') . '</h3>', '', $current, $post_id, $args);
    }
    wp_die();
}