• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpcf_admin_fields_save_field_last_settings函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wpcf_admin_fields_save_field_last_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP wpcf_admin_fields_save_field_last_settings函数的具体用法?PHP wpcf_admin_fields_save_field_last_settings怎么用?PHP wpcf_admin_fields_save_field_last_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wpcf_admin_fields_save_field_last_settings函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wpcf_fields_numeric_editor_submit

/**
 * Editor callback form submit.
 */
function wpcf_fields_numeric_editor_submit()
{
    $add = '';
    if (!empty($_POST['format'])) {
        $add .= ' format="' . strval($_POST['format']) . '"';
    }
    $field = wpcf_admin_fields_get_field($_GET['field_id']);
    if (!empty($field)) {
        $shortcode = wpcf_fields_get_shortcode($field, $add);
        wpcf_admin_fields_save_field_last_settings($_GET['field_id'], array('format' => $_POST['format']));
        echo editor_admin_popup_insert_shortcode_js($shortcode);
        die;
    }
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:17,代码来源:numeric.php


示例2: wpcf_fields_email_editor_submit

/**
 * Editor callback form submit.
 */
function wpcf_fields_email_editor_submit()
{
    $add = '';
    if (!empty($_POST['title'])) {
        $add = ' title="' . strval($_POST['title']) . '"';
    }
    $field = wpcf_admin_fields_get_field($_GET['field_id']);
    if (!empty($field)) {
        $shortcode = wpcf_fields_get_shortcode($field, $add);
        wpcf_admin_fields_save_field_last_settings($_GET['field_id'], $_POST);
        echo wpcf_admin_fields_popup_insert_shortcode_js($shortcode);
        die;
    }
}
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:17,代码来源:email.php


示例3: wpcf_fields_image_editor_submit

/**
 * Editor callback form submit.
 */
function wpcf_fields_image_editor_submit($data, $field, $context)
{
    // Saved settings
    $settings = array();
    $add = '';
    if (!empty($data['alt'])) {
        $add .= ' alt="' . strval($data['alt']) . '"';
    }
    if (!empty($data['title'])) {
        $add .= ' title="' . strval($data['title']) . '"';
    }
    $size = !empty($data['image_size']) ? $data['image_size'] : false;
    if ($size == 'wpcf-custom') {
        if (!empty($data['width'])) {
            $add .= ' width="' . intval($data['width']) . '"';
        }
        if (!empty($data['height'])) {
            $add .= ' height="' . intval($data['height']) . '"';
        }
    } else {
        if (!empty($size)) {
            $add .= ' size="' . $size . '"';
            $settings['image_size'] = $size;
        }
    }
    if (!empty($data['alignment'])) {
        $add .= ' align="' . $data['alignment'] . '"';
        $settings['alignment'] = $data['alignment'];
    }
    if (!empty($data['url'])) {
        $add .= ' url="true"';
    }
    if (!empty($data['onload'])) {
        $add .= ' onload="' . $data['onload'] . '"';
    }
    if (array_key_exists('image_size', $data) && $data['image_size'] != 'full') {
        if (!empty($data['proportional'])) {
            $settings['resize'] = isset($data['resize']) ? $data['resize'] : 'proportional';
            $add .= " resize=\"{$settings['resize']}\"";
            if ($settings['resize'] == 'pad') {
                if (isset($data['padding_transparent'])) {
                    $data['padding_color'] = 'transparent';
                }
                if (empty($data['padding_color'])) {
                    $data['padding_color'] = '#FFF';
                }
                if ((strpos($data['padding_color'], '#') !== 0 || !(strlen($data['padding_color']) == 4 || strlen($data['padding_color']) == 7)) && $data['padding_color'] != 'transparent') {
                    $data['padding_color'] = '#FFF';
                }
                $settings['padding_color'] = $data['padding_color'];
                $add .= " padding_color=\"{$data['padding_color']}\"";
            }
        } else {
            if (!isset($data['raw_mode'])) {
                $settings['resize'] = 'stretch';
                $add .= ' resize="stretch"';
            }
        }
    }
    $field = apply_filters('wpcf_fields_image_editor_submit_field', $field);
    // Save settings
    wpcf_admin_fields_save_field_last_settings($field['id'], $settings);
    if ($context == 'usermeta') {
        $add .= wpcf_get_usermeta_form_addon_submit();
        $shortcode = wpcf_usermeta_get_shortcode($field, $add);
    } elseif ($context == 'termmeta') {
        $add .= wpcf_get_termmeta_form_addon_submit();
        $shortcode = wpcf_termmeta_get_shortcode($field, $add);
    } else {
        $shortcode = wpcf_fields_get_shortcode($field, $add);
    }
    return $shortcode;
}
开发者ID:torch2424,项目名称:Team-No-Comply-Games-Wordpress,代码行数:76,代码来源:image.php


示例4: wpcf_fields_google_map_editor_submit

/**
 * Processes editor popup submit
 */
function wpcf_fields_google_map_editor_submit()
{
    // Get field
    $field = wpcf_admin_fields_get_field(strval($_GET['field_id']));
    if (!empty($field)) {
        $add = '';
        // Add parameters
        if (!empty($_POST['width'])) {
            $add .= ' width="' . strval($_POST['width']) . '"';
        }
        if (!empty($_POST['height'])) {
            $add .= ' height="' . strval($_POST['height']) . '"';
        }
        // Generate shortcode
        $shortcode = wpcf_fields_get_shortcode($field, $add);
        // Save settings
        wpcf_admin_fields_save_field_last_settings($_GET['field_id'], $_POST);
        // Trigger inserting shortcode in parent editor
        echo editor_admin_popup_insert_shortcode_js($shortcode);
    }
    die;
}
开发者ID:pwillems,项目名称:mimosa-contents,代码行数:25,代码来源:google-map.php


示例5: wpcf_fields_file_editor_submit

/**
 * Editor callback form submit.
 */
function wpcf_fields_file_editor_submit()
{
    $add = '';
    if (!empty($_POST['link'])) {
        $add .= ' link="true"';
        if (!empty($_POST['title'])) {
            $add .= ' title="' . strval($_POST['title']) . '"';
        }
    }
    if (!empty($_POST['class'])) {
        $add .= ' class="' . $_POST['class'] . '"';
    }
    if (!empty($_POST['style'])) {
        $add .= ' style="' . $_POST['style'] . '"';
    }
    $field = wpcf_admin_fields_get_field($_GET['field_id']);
    if (!empty($field)) {
        $shortcode = wpcf_fields_get_shortcode($field, $add);
        wpcf_admin_fields_save_field_last_settings($_GET['field_id'], $_POST);
        echo editor_admin_popup_insert_shortcode_js($shortcode);
        die;
    }
}
开发者ID:par-orillonsoft,项目名称:Wishmagnet,代码行数:26,代码来源:file.php


示例6: wpcf_fields_date_editor_form_submit

/**
 * Inserts shortcode in editor.
 * 
 * @return type 
 */
function wpcf_fields_date_editor_form_submit()
{
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php';
    if (!isset($_POST['wpcf']['field_id'])) {
        return false;
    }
    $field = wpcf_admin_fields_get_field($_POST['wpcf']['field_id']);
    if (empty($field)) {
        return false;
    }
    $add = ' ';
    $style = isset($_POST['wpcf']['style']) ? $_POST['wpcf']['style'] : 'text';
    $add .= 'style="' . $style . '"';
    $format = '';
    if ($style == 'text') {
        if ($_POST['wpcf']['format'] == 'custom') {
            $format = $_POST['wpcf']['format-custom'];
        } else {
            $format = $_POST['wpcf']['format'];
        }
        if (empty($format)) {
            $format = get_option('date_format');
        }
        $add .= ' format="' . $format . '"';
    }
    $shortcode = wpcf_fields_get_shortcode($field, $add);
    wpcf_admin_fields_save_field_last_settings($_POST['wpcf']['field_id'], array('style' => $style, 'format' => $_POST['wpcf']['format'], 'format-custom' => $_POST['wpcf']['format-custom']));
    echo editor_admin_popup_insert_shortcode_js($shortcode);
    die;
}
开发者ID:par-orillonsoft,项目名称:Wishmagnet,代码行数:35,代码来源:date.php


示例7: wpcf_fields_image_editor_submit

/**
 * Editor callback form submit.
 */
function wpcf_fields_image_editor_submit()
{
    $add = '';
    if (!empty($_POST['alt'])) {
        $add .= ' alt="' . strval($_POST['alt']) . '"';
    }
    if (!empty($_POST['title'])) {
        $add .= ' title="' . strval($_POST['title']) . '"';
    }
    $size = !empty($_POST['image-size']) ? $_POST['image-size'] : false;
    if ($size == 'wpcf-custom') {
        if (!empty($_POST['width'])) {
            $add .= ' width="' . intval($_POST['width']) . '"';
        }
        if (!empty($_POST['height'])) {
            $add .= ' height="' . intval($_POST['height']) . '"';
        }
        if (!empty($_POST['proportional'])) {
            $add .= ' proportional="true"';
        }
    } else {
        if (!empty($size)) {
            $add .= ' size="' . $size . '"';
        }
    }
    if (!empty($_POST['alignment'])) {
        $add .= ' align="' . $_POST['alignment'] . '"';
    }
    $field = wpcf_admin_fields_get_field($_GET['field_id']);
    if (!empty($field)) {
        $shortcode = wpcf_fields_get_shortcode($field, $add);
        wpcf_admin_fields_save_field_last_settings($_GET['field_id'], $_POST);
        echo wpcf_admin_fields_popup_insert_shortcode_js($shortcode);
        die;
    }
}
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:39,代码来源:image.php



注:本文中的wpcf_admin_fields_save_field_last_settings函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpcf_admin_fields_save_fields函数代码示例发布时间:2022-05-23
下一篇:
PHP wpcf_admin_fields_save_field函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap