| Server IP : 43.130.17.34 / Your IP : 216.73.217.6 Web Server : nginx/1.28.0 System : Linux VM-4-12-opencloudos 6.6.92-34.1.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 25 21:32:13 CST 2025 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/yespkg.com/wp-content/plugins/bb-plugin/classes/ |
Upload File : |
<?php
/**
* Helper class for builder shortcodes
*
* @since 1.7
*/
final class FLBuilderShortcodes {
/**
* Adds all shortcodes for the builder.
*
* @since 1.7
* @return void
*/
static public function init()
{
add_shortcode( 'fl_builder_insert_layout', 'FLBuilderShortcodes::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
*/
static public function insert_layout( $attrs )
{
$builder_active = in_the_loop() && FLBuilderModel::is_builder_active();
$post_type = isset( $attrs['type'] ) ? $attrs['type'] : get_post_types();
$site_id = isset( $attrs['site'] ) ? absint( $attrs['site'] ) : null;
$args = array(
'post_type' => $post_type,
'posts_per_page' => -1
);
// Build the args array.
if ( isset( $attrs['id'] ) ) {
$args['orderby'] = 'post__in';
$args['ignore_sticky_posts'] = true;
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, $site_id );
if ( $builder_active ) {
echo '</div>';
}
return ob_get_clean();
}
}
FLBuilderShortcodes::init();