本文整理汇总了PHP中FLBuilderModel类的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel类的具体用法?PHP FLBuilderModel怎么用?PHP FLBuilderModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FLBuilderModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: insert_layout
/**
* Renders a layout with the provided post ID and enqueues the
* necessary styles and scripts.
*
* @since 1.7
* @param array $attrs The shortcode attributes.
* @return string
*/
public static function insert_layout($attrs)
{
$builder_active = in_the_loop() && FLBuilderModel::is_builder_active();
$post_type = isset($attrs['type']) ? $attrs['type'] : get_post_types();
$args = array('post_type' => $post_type, 'posts_per_page' => -1);
// Build the args array.
if (isset($attrs['id'])) {
$args['orderby'] = 'post__in';
if (is_numeric($attrs['id'])) {
$args['post__in'] = array($attrs['id']);
} else {
$args['post__in'] = explode(',', $attrs['id']);
}
} else {
if (isset($attrs['slug'])) {
$args['orderby'] = 'name';
$args['name'] = $attrs['slug'];
} else {
return;
}
}
// Render and return the layout.
ob_start();
if ($builder_active) {
echo '<div class="fl-builder-shortcode-mask-wrap"><div class="fl-builder-shortcode-mask"></div>';
}
FLBuilder::render_query($args);
if ($builder_active) {
echo '</div>';
}
return ob_get_clean();
}
开发者ID:nullality,项目名称:FEWD-SEA-7,代码行数:40,代码来源:class-fl-builder-shortcodes.php
示例2: submit
/**
* Called via AJAX to submit the subscribe form.
*
* @since 1.5.2
* @return string The JSON encoded response.
*/
public function submit()
{
$name = isset($_POST['name']) ? sanitize_text_field($_POST['name']) : false;
$email = isset($_POST['email']) ? sanitize_email($_POST['email']) : false;
$node_id = isset($_POST['node_id']) ? sanitize_text_field($_POST['node_id']) : false;
$result = array('action' => false, 'error' => false, 'message' => false, 'url' => false);
if ($email && $node_id) {
$module = FLBuilderModel::get_module($node_id);
$settings = $module->settings;
// Subscribe.
$instance = FLBuilderServices::get_service_instance($settings->service);
$response = $instance->subscribe($settings, $email, $name);
// Check for an error from the service.
if ($response['error']) {
$result['error'] = $response['error'];
} else {
$result['action'] = $settings->success_action;
if ('message' == $settings->success_action) {
$result['message'] = $settings->success_message;
} else {
$result['url'] = $settings->success_url;
}
}
} else {
$result['error'] = __('There was an error subscribing. Please try again.', 'fl-builder');
}
echo json_encode($result);
die;
}
开发者ID:spokencode,项目名称:bophillips,代码行数:35,代码来源:subscribe-form.php
示例3: brj_enqueue_minimap
function brj_enqueue_minimap()
{
if (is_user_logged_in() && class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
wp_enqueue_script('bb-minimap', plugins_url('bb-minimap.js', __FILE__), array('jquery', 'wp-util'));
wp_enqueue_style('bb-minimap', plugins_url('css/bb-minimap.css', __FILE__));
}
}
开发者ID:brentjett,项目名称:bb-experiments,代码行数:7,代码来源:bb-minimap.php
示例4: receptar_bb_assets
function receptar_bb_assets()
{
//Styles
if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
wp_enqueue_style('receptar-bb-addon', receptar_get_stylesheet_directory_uri('css/beaver-builder-editor.css'), false, esc_attr(trim(wp_get_theme()->get('Version'))), 'screen');
}
}
开发者ID:kanenas,项目名称:receptar,代码行数:7,代码来源:beaver-builder.php
示例5: get_items
function get_items($request)
{
$templates = array();
$user_templates = get_posts(array('post_type' => 'fl-builder-template', 'orderby' => 'menu_order title', 'order' => 'ASC', 'posts_per_page' => -1, 'fl-builder-template-type' => 'layout'));
//$user_templates = FLBuilderModel::get_user_templates();
if (!empty($user_templates)) {
foreach ($user_templates as $post) {
$layout = get_post_meta($post->ID, '_fl_builder_data', true);
if ($layout) {
$categories = get_post_meta($post->ID, 'template_categories', true);
if (empty($categories)) {
$categories = array('saved');
}
$templates[] = array('handle' => $post->ID, 'label' => $post->post_title, 'description' => $post->post_excerpt, 'author' => $post->post_author, 'modified' => $post->post_modified, 'edit_link' => FLBuilderModel::get_edit_url($post->ID), 'categories' => $categories, 'type' => 'user', 'is_global' => get_post_meta($post->ID, '_fl_builder_template_global', true), 'is_editable' => true);
}
}
}
$template_data = FLBuilderModel::get_templates();
if (!empty($template_data)) {
foreach ($template_data as $data) {
$templates[] = array('handle' => $data->index, 'label' => $data->name, 'screenshot' => array('thumbnail' => FL_BUILDER_URL . 'img/templates/' . $data->image), 'author' => array('name' => 'Beaver Builder Team'), 'categories' => array($data->category), 'is_premium' => $data->premium, 'is_builtin' => true, 'type' => 'core');
}
}
$response = rest_ensure_response($templates);
return $response;
}
开发者ID:brentjett,项目名称:brj-template-browser,代码行数:26,代码来源:class-brj-rest-templates-controller.php
示例6: print_custom_css
function print_custom_css()
{
$fields = self::get_color_fields();
$settings = FLBuilderModel::get_global_settings();
print "<style id='bb-ui-theme-custom'>\n";
foreach ($fields as $name => $field) {
$color = '#' . $settings->{$name};
$properties = $field['properties'];
$selectors = $field['selectors'];
foreach ($selectors as $selector) {
print $selector . "{\n";
foreach ($properties as $property) {
print $property . " : " . $color;
}
print "}\n";
}
}
?>
body .fl-builder-blocks-section .fl-builder-blocks-section-title:hover,
body .fl-builder-blocks-section .fl-builder-blocks-section-title:hover i {
background:transparent;
}
<?php
print "</style>\n";
}
开发者ID:brentjett,项目名称:bb-experiments,代码行数:25,代码来源:class-bb-ui-themes.php
示例7: zestsms_pdf_field_assets
function zestsms_pdf_field_assets()
{
if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
wp_enqueue_style('zestsms-pdf', FIELDS_URL . 'pdf/css/zestsms-pdf.css', array(), '');
wp_enqueue_script('zestsms-pdf', FIELDS_URL . 'pdf/js/zestsms-pdf.js', array(), '', true);
}
}
开发者ID:ZestSMS,项目名称:BB-PDF-field,代码行数:7,代码来源:zestsms-pdf.php
示例8: tesseract_add_button_to_page_builder
/**
* Adds HTML to the bottom of the Beaver Builder Page Builder interface, which is used in a
* modal to allow content blocks to be added to the page.
*/
function tesseract_add_button_to_page_builder()
{
if (!defined('DOING_AJAX')) {
if (!FLBuilderModel::is_builder_active()) {
return;
}
}
$templates_query = new WP_Query(array('post_type' => 'fl-builder-template', 'meta_key' => Tesseract_Importer_Constants::$CONTENT_BLOCK_META_KEY, 'meta_value' => 1, 'posts_per_page' => 999));
?>
<div id="tesseract-content-blocks-wrapper">
<div class="cancel-wrapper">
<span class="fl-builder-blocks-update fl-builder-button fl-builder-button-primary fl-builder-button-large pull-left"><i class="fa fa-refresh"></i></span>
<span class="fl-builder-blocks-update-message pull-left"></span>
<span class="fl-builder-cancel-button fl-builder-button fl-builder-button-primary fl-builder-button-large">Cancel</span>
</div>
<?php
while ($templates_query->have_posts()) {
$templates_query->the_post();
?>
<?php
$template_id = get_the_ID();
?>
<?php
global $post;
$slug = $post->post_name;
?>
<div class="content-block slug-<?php
echo esc_attr($slug);
?>
"
style="background-image: url('<?php
echo esc_attr(get_stylesheet_directory_uri());
?>
/images/content-blocks/<?php
echo esc_attr($slug);
?>
.jpg')">
<a href="#" class="append-content-button" data-template-id="<?php
echo esc_attr($template_id);
?>
">
<?php
the_title();
?>
</a>
</div>
<?php
}
?>
<div class="cancel-wrapper">
<span class="fl-builder-blocks-update fl-builder-button fl-builder-button-primary fl-builder-button-large pull-left"><i class="fa fa-refresh"></i></span>
<span class="fl-builder-blocks-update-message pull-left"></span>
<span class="fl-builder-cancel-button fl-builder-button fl-builder-button-primary fl-builder-button-large">Cancel</span>
</div>
</div>
<?php
if (defined('DOING_AJAX') && DOING_AJAX) {
die;
}
}
开发者ID:Nirajjcu,项目名称:minime3d,代码行数:64,代码来源:beaver-builder-extensions.php
示例9: tesseract_enqueue_beaver_builder_scripts
function tesseract_enqueue_beaver_builder_scripts()
{
if (FLBuilderModel::is_builder_active()) {
wp_enqueue_script('tesseract-bb-extensions', get_template_directory_uri() . '/importer/js/beaver-builder.js', array('jquery'));
wp_enqueue_style('tesseract-bb-extensions', get_template_directory_uri() . '/importer/css/beaver-builder.css');
}
}
开发者ID:pakyinsun,项目名称:TESSERACT,代码行数:7,代码来源:beaver-builder-extensions.php
示例10: enqueue_scripts
public function enqueue_scripts()
{
if ($this->settings->marker == 'icon' || FLBuilderModel::is_builder_active()) {
$this->add_js('geocomplete', '//cdnjs.cloudflare.com/ajax/libs/geocomplete/1.6.5/jquery.geocomplete.min.js', array('jquery'), '1.6.5', true);
$this->add_js('marker-with-label', $this->url . 'js/markerwithlabel.js', array('googlemaps-api'), NULL, true);
}
}
开发者ID:ZestSMS,项目名称:BB-Override-Modules,代码行数:7,代码来源:map.php
示例11: menu
/**
* Renders the network admin menu for multisite installs.
*
* @since 1.0
* @return void
*/
public static function menu()
{
$title = FLBuilderModel::get_branding();
$cap = 'manage_network_plugins';
$slug = 'fl-builder-multisite-settings';
$func = 'FLBuilderAdminSettings::render';
add_submenu_page('settings.php', $title, $title, $cap, $slug, $func);
}
开发者ID:onedaylabs,项目名称:onedaylabs.com,代码行数:14,代码来源:class-fl-builder-multisite-settings.php
示例12: zestsms_timepicker_field_assets
function zestsms_timepicker_field_assets()
{
if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
wp_enqueue_script('jquery-timepicker', ZESTSMS_FIELDS_URL . 'zestsms-timepicker/js/lib/jquery.timepicker.min.js', array('jquery'), '1.8.0', true);
wp_enqueue_script('zestsms-timepicker', ZESTSMS_FIELDS_URL . 'zestsms-timepicker/js/zestsms-timepicker.js', array('jquery-timepicker'), '1.0', true);
wp_enqueue_style('jquery-timepicker', ZESTSMS_FIELDS_URL . 'zestsms-timepicker/css/lib/jquery.timepicker.css', false, null);
}
}
开发者ID:ZestSMS,项目名称:BB-fields,代码行数:8,代码来源:zestsms-timepicker.php
示例13: get_account_data
/**
* Get the saved data for a specific account.
*
* @since 1.5.4
* @param string $account The account name.
* @return array|bool The account data or false if it doesn't exist.
*/
public function get_account_data($account)
{
$saved_services = FLBuilderModel::get_services();
if (isset($saved_services[$this->id]) && isset($saved_services[$this->id][$account])) {
return $saved_services[$this->id][$account];
}
return false;
}
开发者ID:nullality,项目名称:FEWD-SEA-7,代码行数:15,代码来源:class-fl-builder-service.php
示例14: zestsms_geocomplete_field_assets
function zestsms_geocomplete_field_assets()
{
if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
wp_enqueue_script('googlemaps-api', '//maps.googleapis.com/maps/api/js?v=3&sensor=false&libraries=places', array(), NULL, true);
wp_enqueue_script('geocomplete', ZESTSMS_FIELDS_URL . 'zestsms-geocomplete/js/lib/jquery.geocomplete.min.js', array('jquery'), '1.6.5', true);
wp_enqueue_script('zestsms-geocomplete', ZESTSMS_FIELDS_URL . 'zestsms-geocomplete/js/zestsms-geocomplete.js', array('jquery', 'geocomplete'), '1.0', true);
wp_enqueue_style('zestsms-geocomplete', ZESTSMS_FIELDS_URL . 'zestsms-geocomplete/css/zestsms-geocomplete.css');
}
}
开发者ID:ZestSMS,项目名称:BB-fields,代码行数:9,代码来源:zestsms-geocomplete.php
示例15: install_for_new_blog
/**
* Runs the install for a newly created site.
*
* @since 1.0
* @param int $blog_id
* @param int $user_id
* @param string $domain
* @param string $path
* @param int $site_id
* @param array $meta
* @return void
*/
public static function install_for_new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta)
{
global $wpdb;
if (is_plugin_active_for_network(FLBuilderModel::plugin_basename())) {
switch_to_blog($blog_id);
FLBuilderAdmin::install();
restore_current_blog();
}
}
开发者ID:onedaylabs,项目名称:onedaylabs.com,代码行数:21,代码来源:class-fl-builder-multisite.php
示例16: requiredPluginActive
public function requiredPluginActive()
{
if (!apply_filters('toolset_is_views_available', false)) {
return false;
}
if (defined('FL_BUILDER_VERSION')) {
$this->name = FLBuilderModel::get_branding();
return true;
}
return false;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:11,代码来源:beaver.php
示例17: enqueue_scripts
/**
* @method enqueue_scripts
*/
public function enqueue_scripts()
{
if (FLBuilderModel::is_builder_active() || $this->settings->layout == 'grid') {
$this->add_js('jquery-masonry');
}
if (FLBuilderModel::is_builder_active() || $this->settings->layout == 'gallery') {
$this->add_js('fl-gallery-grid');
}
if (FLBuilderModel::is_builder_active() || $this->settings->pagination == 'scroll') {
$this->add_js('jquery-infinitescroll');
}
}
开发者ID:spokencode,项目名称:bophillips,代码行数:15,代码来源:post-grid.php
示例18: zestsms_datepicker_field_assets
function zestsms_datepicker_field_assets()
{
global $wp_scripts;
if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('zestsms-datepicker', ZESTSMS_FIELDS_URL . 'zestsms-datepicker/js/zestsms-datepicker.js', array('jquery-ui-core'), '', true);
$ui = $wp_scripts->query('jquery-ui-core');
// tell WordPress to load the Smoothness theme from Google CDN
$protocol = is_ssl() ? 'https' : 'http';
$url = "{$protocol}://ajax.googleapis.com/ajax/libs/jqueryui/{$ui->ver}/themes/smoothness/jquery-ui.min.css";
wp_enqueue_style('jquery-ui-smoothness', $url, false, null);
wp_enqueue_style('zestsms-datepicker', ZESTSMS_FIELDS_URL . 'zestsms-datepicker/css/zestsms-datepicker.css', false, null);
}
}
开发者ID:ZestSMS,项目名称:BB-fields,代码行数:15,代码来源:zestsms-datepicker.php
示例19: get_templates
function get_templates()
{
/*
$user_templates = get_posts( array(
'post_type' => 'fl-builder-template',
'orderby' => 'menu_order title',
'order' => 'ASC',
'posts_per_page' => -1,
'fl-builder-template-type' => 'layout'
));
*/
// Temp
$template_data = FLBuilderModel::get_templates();
return $template_data;
}
开发者ID:brentjett,项目名称:bb-experiments,代码行数:15,代码来源:brj-template-collection.php
示例20: print_template_html
/**
* Print the base html and all template scripts.
* @return void
*/
function print_template_html()
{
if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
?>
<div id="brj-store-modal-root" class="fl-template-browser-modal brj-store-modal fl-lightbox-wrap"></div>
<?php
require_once FLBUILDER_BROWSER_DIR . 'templates/root-view.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/sidebar-view.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/screen-templates.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/screen-template-single.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/screen-template-setup-library.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/screen-template-library.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/item-template.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/item-collection-sidebar.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/empty-no-templates.php';
require_once FLBUILDER_BROWSER_DIR . 'templates/screen-template-import-template.php';
}
}
开发者ID:brentjett,项目名称:brj-template-browser,代码行数:22,代码来源:class-fl-builder-template-browser.php
注:本文中的FLBuilderModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论