Example #1
1
function wp_smap_admin_notice()
{
    add_thickbox();
    $sharelink_text_array = array("I use Social Media Auto Publish wordpress plugin from @xyzscripts and you should too.", "Social Media Auto Publish wordpress plugin from @xyzscripts is awesome", "Thanks @xyzscripts for developing such a wonderful social media auto publishing wordpress plugin", "I was looking for a social media publishing plugin and I found this. Thanks @xyzscripts", "Its very easy to use Social Media Auto Publish wordpress plugin from @xyzscripts", "I installed Social Media Auto Publish from @xyzscripts,it works flawlessly", "Social Media Auto Publish wordpress plugin that i use works terrific", "I am using Social Media Auto Publish wordpress plugin from @xyzscripts and I like it", "The Social Media Auto Publish plugin from @xyzscripts is simple and works fine", "I've been using this social media plugin for a while now and it is really good", "Social Media Auto Publish wordpress plugin is a fantastic plugin", "Social Media Auto Publish wordpress plugin is easy to use and works great. Thank you!", "Good and flexible  social media auto publish plugin especially for beginners", "The best social media auto publish wordpress plugin I have used ! THANKS @xyzscripts");
    $sharelink_text = array_rand($sharelink_text_array, 1);
    $sharelink_text = $sharelink_text_array[$sharelink_text];
    echo '<div id="smap_notice_td" style="clear:both;width:98%;background: none repeat scroll 0pt 0pt #FBFCC5; border: 1px solid #EAEA09;padding:5px;">
	<p>It looks like you have been enjoying using <a href="https://wordpress.org/plugins/social-media-auto-publish/" target="_blank"> Social Media Auto Publish</a> plugin from Xyzscripts for atleast 30 days.  Would you consider supporting us with the continued development of the plugin using any of the below methods ?</p>
	<p>
	<a href="https://wordpress.org/support/view/plugin-reviews/social-media-auto-publish" class="button" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Rate it 5★\'s on wordpress</a>
	<a href="http://xyzscripts.com/wordpress-plugins/social-media-auto-publish/purchase" class="button" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Purchase premium version</a>';
    if (get_option('xyz_credit_link') == "0") {
        echo '<a class="button xyz_smap_backlink" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Enable backlink</a>';
    }
    echo '<a href="#TB_inline?width=250&height=75&inlineId=show_share_icons_smap" class="button thickbox" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Share on</a>
	
	<a href="admin.php?page=social-media-auto-publish-settings&smap_notice=hide" class="button" style="color:black;text-decoration:none;margin-right:4px;">Don\'t Show This Again</a>
	</p>
	
	<div id="show_share_icons_smap" style="display: none;">
	<a class="button" style="background-color:#3b5998;color:white;margin-right:4px;margin-left:100px;margin-top: 25px;" href="http://www.facebook.com/sharer/sharer.php?u=http://xyzscripts.com/wordpress-plugins/social-media-auto-publish/" target="_blank">Facebook</a>
	<a class="button" style="background-color:#00aced;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="http://twitter.com/share?url=http://xyzscripts.com/wordpress-plugins/social-media-auto-publish/&text=' . $sharelink_text . '" target="_blank">Twitter</a>
	<a class="button" style="background-color:#007bb6;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="http://www.linkedin.com/shareArticle?mini=true&url=http://xyzscripts.com/wordpress-plugins/social-media-auto-publish/" target="_blank">LinkedIn</a>
	<a class="button" style="background-color:#dd4b39;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="https://plus.google.com/share?&hl=en&url=http://xyzscripts.com/wordpress-plugins/social-media-auto-publish/" target="_blank">Google +</a>
	</div>
	</div>';
}
function rb_portfolio_loop_content()
{
    if (have_posts()) {
        add_thickbox();
        while (have_posts()) {
            the_post();
            ?>

			<article <?php 
            post_class();
            ?>
>

    		<?php 
            rb_portfolio_add_image();
            //rb_portfolio_featured_post_image();
            the_date('F Y', '<span class="portfolio-date">', '</span>');
            genesis_do_post_title();
            rb_portfolio_add_authors();
            rb_portfolio_display_thickbox_content();
            ?>

    		</article>

			<?php 
        }
    }
}
 public function load_admin_scripts($hook)
 {
     global $sc_settings_page;
     if ($hook != $sc_settings_page) {
         return;
     }
     wp_enqueue_script('word-count');
     wp_enqueue_script('post');
     if (user_can_richedit()) {
         wp_enqueue_script('editor');
     }
     add_thickbox();
     wp_enqueue_script('media-upload');
     wp_enqueue_media();
     wp_enqueue_style('wp-color-picker');
     wp_enqueue_script('wp-color-picker');
     wp_enqueue_script('jquery-ui-slider');
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('jquery-effects-core');
     wp_enqueue_script('jquery-effects-slide');
     wp_enqueue_style('jquery-ui-style', '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css');
     // Codemirror
     // wp_enqueue_script( 'codemirror-js', plugins_url( '/assets/codemirror-compressed.js', SC_ADS_DIR ), false, false, true  );
     // wp_enqueue_script( 'codemirror-closebrackets-js', plugins_url( '/assets/codemirror-closebrackets.js', SC_ADS_DIR ), false, false, true  );
     // wp_enqueue_style( 'codemirror-css',  plugins_url( '/assets/codemirror.css', SC_ADS_DIR ) );
     // Admin Assets
     wp_enqueue_script('sc-ads-admin-js', plugins_url('/assets/admin-scripts.js', SC_ADS_DIR), array('jquery', 'wp-color-picker'), false, true);
     wp_enqueue_style('sc-ads-admin-css', plugins_url('/assets/admin-style.css', SC_ADS_DIR));
 }
 function assets($hook)
 {
     $parent = SWP();
     $base_url = trailingslashit($parent->url);
     wp_register_style('select2', $base_url . 'assets/vendor/select2/select2.css', null, '3.4.1', 'screen');
     wp_register_style('swp_admin_css', $base_url . 'assets/css/searchwp.css', false, SEARCHWP_VERSION);
     wp_register_style('swp_settings_css', $base_url . 'assets/css/searchwp-settings.css', false, SEARCHWP_VERSION);
     wp_register_style('swp_settings_tabs_css', $base_url . 'assets/css/searchwp-settings-tabs.css', false, SEARCHWP_VERSION);
     wp_register_script('select2', $base_url . 'assets/vendor/select2/select2.min.js', array('jquery'), '3.4.1', false);
     wp_register_script('swp_admin_js', $base_url . 'assets/js/searchwp.js', array('jquery', 'select2'), SEARCHWP_VERSION);
     wp_register_script('swp_progress', $base_url . 'assets/js/searchwp-progress.js', array('jquery'), SEARCHWP_VERSION);
     // we only want our assets on our Settings page
     if ('settings_page_searchwp' == $hook) {
         add_thickbox();
         wp_enqueue_style('swp_admin_css');
         wp_enqueue_style('swp_settings_css');
         wp_enqueue_style('swp_settings_tabs_css');
         wp_enqueue_style('select2');
         wp_enqueue_script('underscore');
         wp_enqueue_script('jquery');
         wp_enqueue_script('jquery-ui-tooltip');
         wp_enqueue_script('select2');
         // wp_enqueue_script( 'swp_admin_js' ); // this is echo'd directly into the page
         // only trigger the progress script if it's not the alternative indexer
         if (!isset($_GET['nonce']) && !$parent->is_using_alternate_indexer()) {
             // if a nonce was set we're dealing with advanced settings which might be purging the index
             // if this script were included the background process would be invoked, we don't want that right now
             wp_enqueue_script('swp_progress');
             wp_localize_script('swp_progress', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('swpprogress')));
         }
     }
 }
Example #5
0
 /**
  * Enqueue scripts and styles
  */
 public static function admin_enqueue_scripts()
 {
     parent::admin_enqueue_scripts();
     add_thickbox();
     wp_enqueue_script('media-upload');
     wp_enqueue_script('swpmb-thickbox-image', SWPMB_JS_URL . 'thickbox-image.js', array('jquery'), SWP_VERSION, true);
 }
function solo_add_thickbox()
{
    global $post;
    if (is_singular() && strpos($post->post_content, 'class="thickbox"') !== false) {
        add_thickbox();
    }
}
Example #7
0
function wp_fbap_admin_notice()
{
    add_thickbox();
    $sharelink_text_array_fb = array("I Use Facebook Auto Publish  wordpress plugin from @xyzscriptsdotcom and you should too", "Facebook Auto Publish  wordpress Plugin from @xyzscriptsdotcom is Awesome", "Actually i am looking for a social media Plugin like this. Thanks @xyzscriptsdotcom", "Its very nice to use Facebook Auto Publish  wordpress Plugin from @xyzscriptsdotcom", "I installed Facebook Auto Publish .. from @xyzscriptsdotcom,  It works wonderful", "The Facebook Auto Publish  icon wordpress plugin looks soo nice.. thanks @xyzscriptsdotcom", "It awesome to use Facebook Auto Publish  wordpress plugin from @xyzscriptsdotcom -", "Facebook Auto Publish  wordpress Plugin that i use Looks awesome and works terrific", "I am using Facebook Auto Publish  Icon wordpress Plugin from @xyzscriptsdotcom I like it!", "Facebook Auto Publish  Icon wordpress plugin is Fantastic Plugin", "Facebook Auto Publish  Icon wordpress plugin was easy to use and works great. thank you!", "Good and flexible wp socialmedia plugin especially for beginners.", "Easily the best socialmedia wordpress plugin of the type I have used ! THANKS! @xyzscriptsdotcom");
    $sharelink_text_fb = array_rand($sharelink_text_array_fb, 1);
    $sharelink_text_fb = $sharelink_text_array_fb[$sharelink_text_fb];
    echo '<div id="fb_notice_td" class="error" style="color: #c1c1c1;margin-left: 2px;background: none repeat scroll 0pt 0pt infobackground; border: 1px solid inactivecaption; padding: 5px;line-height:16px;">
	<p>It looks like you have been enjoying using <a href="https://wordpress.org/plugins/facebook-auto-publish/" target="_blank"> Facebook Auto Publish  </a> plugin from Xyzscripts for atleast 30 days.Would you consider supporting us with the continued development of the plugin using any of the below methods?</p>
	<p>
	<a href="https://wordpress.org/support/view/plugin-reviews/facebook-auto-publish" class="button" style="color:black;text-decoration:none;padding:5px;margin-right:4px;" target="_blank">Rate it 5★\'s on wordpress</a>
	<a href="http://xyzscripts.com/wordpress-plugins/social-media-auto-publish/purchase" class="button" style="color:black;text-decoration:none;padding:5px;margin-right:4px;" target="_blank">Purchase premium version</a>';
    if (get_option('xyz_credit_link') == "0") {
        echo '<a class="button xyz_fbap_backlink" style="color:black;text-decoration:none;padding:5px;margin-right:4px;" target="_blank">Enable Backlink</a>';
    }
    echo '<a href="#TB_inline?width=250&height=75&inlineId=show_share_icons_fb" class="button thickbox" style="color:black;text-decoration:none;padding:5px;margin-right:4px;" target="_blank">Share on</a>
	
	<a href="admin.php?page=facebook-auto-publish-settings&fbap_notice=hide" class="button" style="color:black;text-decoration:none;padding:5px;margin-right:4px;">Don\'t Show This Again</a>
	</p>
	
	<div id="show_share_icons_fb" style="display: none;">
	<a class="button" style="background-color:#3b5998;color:white;margin-right:4px;margin-left:100px;margin-top: 25px;" href="http://www.facebook.com/sharer/sharer.php?u=https://wordpress.org/plugins/facebook-auto-publish/&text=' . $sharelink_text_fb . '" target="_blank">Facebook</a>
	<a class="button" style="background-color:#00aced;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="http://twitter.com/share?url=https://wordpress.org/plugins/facebook-auto-publish/&text=' . $sharelink_text_fb . '" target="_blank">Twitter</a>
	<a class="button" style="background-color:#007bb6;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="http://www.linkedin.com/shareArticle?mini=true&url=https://wordpress.org/plugins/facebook-auto-publish/" target="_blank">LinkedIn</a>
	<a class="button" style="background-color:#dd4b39;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="https://plus.google.com/share?&hl=en&url=https://wordpress.org/plugins/facebook-auto-publish/" target="_blank">google+</a>
	</div>
	
	
	
	</div>';
}
Example #8
0
 /**
  * 
  */
 public function indexAction()
 {
     add_thickbox();
     $this->_pm->getLogger()->logPrefixed('Executing ' . get_class($this) . ':indexAction()');
     $this->_pm->getBootstrap()->getSelftester()->performTests();
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Menu/Help.php';
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Metabox/Container.php';
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Metabox/PremiumAd.php';
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Metabox/PluginInfo.php';
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Metabox/PluginStatus.php';
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Metabox/IfwFeed.php';
     require_once $this->_pm->getPathinfo()->getRootLib() . 'Psn/Admin/Metabox/Rules.php';
     // set up contextual help
     $help = new IfwPsn_Wp_Plugin_Menu_Help($this->_pm);
     $help->setTitle(__('Overview', 'psn'))->setHelp($this->_getHelpText())->setSidebar($this->_getHelpSidebar())->load();
     // set up metaboxes
     $metaBoxContainerLeft = new IfwPsn_Wp_Plugin_Metabox_Container('column1', $this->_pageHook, 'left');
     IfwPsn_Wp_Proxy_Action::doAction('psn_admin_overview_before_metabox_left', $metaBoxContainerLeft);
     $metaBoxContainerLeft->addMetabox(new Psn_Admin_Metabox_Rules($this->_pm));
     IfwPsn_Wp_Proxy_Action::doAction('psn_admin_overview_after_metabox_left', $metaBoxContainerLeft);
     $metaBoxContainerRight = new IfwPsn_Wp_Plugin_Metabox_Container('column2', $this->_pageHook, 'right');
     IfwPsn_Wp_Proxy_Action::doAction('psn_admin_overview_before_metabox_right', $metaBoxContainerRight);
     if ($this->_pm->hasPremium() && $this->_pm->isPremium() == false) {
         $metaBoxContainerRight->addMetabox(new IfwPsn_Wp_Plugin_Metabox_PremiumAd($this->_pm));
     }
     $metaBoxContainerRight->addMetabox(new IfwPsn_Wp_Plugin_Metabox_PluginInfo($this->_pm));
     $metaBoxContainerRight->addMetabox(new IfwPsn_Wp_Plugin_Metabox_PluginStatus($this->_pm));
     $metaBoxContainerRight->addMetabox(new IfwPsn_Wp_Plugin_Metabox_IfwFeed($this->_pm));
     IfwPsn_Wp_Proxy_Action::doAction('psn_admin_overview_after_metabox_right', $metaBoxContainerRight);
     $this->view->metaBoxContainerLeft = $metaBoxContainerLeft;
     $this->view->metaBoxContainerRight = $metaBoxContainerRight;
 }
Example #9
0
 public function actionMainPage()
 {
     $groups = new Groups();
     // set current group
     if (isset($_GET['group'])) {
         $this->currentGroup = intval($_GET['group']);
     } elseif ($defaultGroup = $groups->get(['default' => 1], ['id'])) {
         $this->currentGroup = $defaultGroup[0]->id;
     } else {
         $this->currentGroup = 0;
     }
     add_thickbox();
     wp_register_style('setget-css', plugins_url() . '/setget/css/style.css');
     wp_register_script('setget-js', plugins_url() . '/setget/js/main.js');
     wp_enqueue_style('setget-css');
     wp_enqueue_script('setget-js');
     // content starts here
     if (isset($_GET['mode']) && $_GET['mode'] == 'groups') {
         $groupsClass = new SetgetGroups();
         $groupsClass->viewPage();
     } else {
         $this->viewSettings();
         $this->viewHead();
         $this->viewGroupLinks();
         $this->viewTableValues();
     }
 }
function adi_fbook_loadscripts()
{
    if (!is_admin()) {
        wp_enqueue_style('adi-facebook', plugins_url() . '/adi-facebook/css/style.css');
        add_thickbox();
    }
}
function add_js_mega_menu()
{
    wp_enqueue_script('set_background', trailingslashit(get_template_directory_uri()) . 'framework/megamenu/js/set_background.js', array('jquery', 'jquery-ui-sortable'), false, true);
    wp_enqueue_style('font-awesome', URI_PATH . '/assets/css/font-awesome.min.css', array(), '4.1.0');
    wp_enqueue_media();
    add_thickbox();
}
Example #12
0
 public static function login_link($args)
 {
     add_thickbox();
     global $ultimatemember;
     $out = '';
     if (is_user_logged_in()) {
         $out .= sprintf('<a href="%s" class="profile-link n8prp-button">Profile</a>', um_user_profile_url());
         $account_page_id = $ultimatemember->permalinks->core['account'];
         if (!empty($account_page_id)) {
             $out .= sprintf('<a href="%s" class="account-link n8prp-button">Account</a>', get_permalink($account_page_id));
         }
         $out .= sprintf('<a href="%s" class="logout-link n8prp-button">Log out</a>', wp_logout_url());
     } else {
         $register_page_id = $ultimatemember->permalinks->core['register'];
         if (!empty($register_page_id)) {
             $out .= sprintf('<a href="%s" class="register-link n8prp-button">Register</a>', get_permalink($register_page_id));
         }
         $login_page_id = $ultimatemember->permalinks->core['login'];
         if (!empty($login_page_id)) {
             $out .= sprintf('<a href="%s" class="login-link n8prp-button">Log in</a>', get_permalink($login_page_id));
         }
         //$out .= sprintf('<div id="n8prp-login-form" style="display:none;">%s</div>', do_shortcode('[ultimatemember form_id=1105]') );
         //$out .= '<a href="#TB_inline?width=300&height=550&inlineId=n8prp-login-form" class="thickbox n8prp-button">Log in</a>';
         //$out .= '<script type="text/javascript">jQuery(\'.thickbox\').each(function(index, value){';
         //$out .= 'var w=window.innerWidth*.85;var h=window.innerHeight*.85;if(w>300){w=300;}';
         //$out .= 'var newHref=jQuery(this).attr(\'href\').replace(\'width=300&height=550\', \'width=\'+w+\'&height=\'+h);';
         //$out .= 'jQuery(this).attr(\'href\',newHref);});</script>';
     }
     return $out;
 }
 /**
  * Enqueue the CSS and JS needed to make the magic happen
  * @param $hook
  */
 public function enqueueTheGoods($hook)
 {
     add_thickbox();
     if ($hook == 'post.php') {
         wp_enqueue_media();
     } else {
         if ($hook == 'upload.php') {
             $mode = get_user_option('media_library_mode', get_current_user_id()) ? get_user_option('media_library_mode', get_current_user_id()) : 'grid';
             if (isset($_GET['mode']) && in_array($_GET['mode'], ['grid', 'list'])) {
                 $mode = $_GET['mode'];
                 update_user_option(get_current_user_id(), 'media_library_mode', $mode);
             }
             if ($mode == 'list') {
                 $version = get_bloginfo('version');
                 if (version_compare($version, '4.2.2') < 0) {
                     wp_dequeue_script('media');
                 }
                 wp_enqueue_media();
             }
         } else {
             wp_enqueue_style('media-views');
         }
     }
     wp_enqueue_style('wp-pointer');
     wp_enqueue_style('ilab-modal-css', ILAB_PUB_CSS_URL . '/ilab-modal.min.css');
     wp_enqueue_style('ilab-media-tools-css', ILAB_PUB_CSS_URL . '/ilab-media-tools.min.css');
     wp_enqueue_script('wp-pointer');
     wp_enqueue_script('ilab-modal-js', ILAB_PUB_JS_URL . '/ilab-modal.js', ['jquery'], false, true);
     wp_enqueue_script('ilab-media-tools-js', ILAB_PUB_JS_URL . '/ilab-media-tools.js', ['jquery'], false, true);
 }
Example #14
0
 function digitalstore_admin_enqueue_scripts($hook_suffix)
 {
     wp_enqueue_style('digitalstore-theme-options', get_template_directory_uri() . '/includes/options/digitalstore.theme.options.css', false);
     wp_enqueue_script('digitalstore-theme-options', get_template_directory_uri() . '/includes/options/digitalstore.theme.options.js', array('farbtastic', 'thickbox'));
     add_thickbox();
     wp_enqueue_style('farbtastic');
 }
Example #15
0
function puma_update_notice()
{
    add_thickbox();
    echo '<div class="updated">
    <p>主题最新版为 ' . get_transient('puma_latest') . ',当前版本 ' . PUMA_VERSION . '。请备份好所有文件,主题升级过程中会删掉原有文件。<a class="thickbox" href="' . admin_url() . 'admin-ajax.php?action=puma_theme_update&TB_iframe=true&width=772&height=312">确认升级</a>
    </p></div>';
}
 /**
  * Show notice
  */
 public function notice()
 {
     // only show to users who have the required capability
     if (!current_user_can(self::CAPABILITY)) {
         return;
     }
     add_thickbox();
     echo '<div class="notice is-dismissible notice-info">';
     # List of required plugins
     echo '<p>';
     echo sprintf(__("%s requires the following plugin(s):", 'mailchimp-for-wp'), '<strong>' . $this->plugin_name . '</strong>');
     echo '<ul class="ul-square">';
     foreach ($this->required_plugins as $plugin) {
         $link_class = '';
         $in_wordpress_repo = preg_match('/wordpress\\.org\\/plugins\\/([\\w+-]+)/i', $plugin['url'], $matches);
         if ($in_wordpress_repo && isset($matches[1])) {
             $slug = $matches[1];
             $plugin['url'] = network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $slug . '&TB_iframe=true&width=600&height=550');
             $link_class = 'thickbox';
         }
         echo sprintf('<li><a href="%s" class="%s">%s</a> (' . __('version %s or higher', 'mailchimp-for-wp') . ')</li>', $plugin['url'], $link_class, $plugin['name'], $plugin['version']);
     }
     echo '</ul>';
     echo __('Either install or update the required plugins. If you already have the required version(s) installed, please do not forget to activate the plugins.', 'mailchimp-for-wp');
     echo '</p>';
     echo '</div>';
 }
Example #17
0
    private function _get_video_info()
    {
        $info = $this->_video->get_info();
        if (!empty($this->_value) && empty($info)) {
            return 'Wrong url entered';
        }
        if (!is_array($info)) {
            return $info;
        }
        add_thickbox();
        return sprintf('
			<dl>
				<dt>Title:</dt>
			   		<dd>%s</dd>
			   	<dt>Description:</dt>
			   		<dd>%s</dd>
			   	<dt>Preview:</dt>
					<dd>
						<a href="%s&TB_iframe=true&width=600&height=550" class="thickbox">
							<img src="%s" alt="%s">
						</a>
					</dd>
				<dt>Duration:</dt>
			   		<dd>%s</dd>
			</dl>

			', $this->_video->get_title(), wp_trim_words($this->_video->get_description()), $this->_video->get_preview(), $this->_video->get_thumbnail(), $this->_video->get_title(), gmdate("H:i:s", $this->_video->get_duration()));
    }
Example #18
0
 public function init()
 {
     $this->min = Redux_Functions::isMin();
     $this->timestamp = ReduxFramework::$_version;
     if ($this->parent->args['dev_mode']) {
         $this->timestamp .= '.' . time();
     }
     $this->register_styles();
     $this->register_scripts();
     add_thickbox();
     $this->enqueue_fields();
     $this->set_localized_data();
     /**
      * action 'redux-enqueue-{opt_name}'
      *
      * @deprecated
      *
      * @param  object $this ReduxFramework
      */
     do_action("redux-enqueue-{$this->parent->args['opt_name']}", $this->parent);
     // REMOVE
     /**
      * action 'redux/page/{opt_name}/enqueue'
      */
     do_action("redux/page/{$this->parent->args['opt_name']}/enqueue");
 }
Example #19
0
function mlfEditorRegisterTinyMCEJavascript($plugin_array)
{
    // Make sure the thickbox modal (dialog box) is available
    add_thickbox();
    $plugin_array['editor'] = get_template_directory_uri() . "/assets/js/admin/editor.js";
    return $plugin_array;
}
Example #20
0
/**
 * Form data for post edit page.
 *
 * @param type $field
 */
function wpcf_fields_skype_meta_box_form($field)
{
    add_thickbox();
    if (isset($field['value'])) {
        $field['value'] = maybe_unserialize($field['value']);
    }
    $form = array();
    add_filter('wpcf_fields_shortcode_slug_' . $field['slug'], 'wpcf_fields_skype_shortcode_filter', 10, 2);
    $rand = wpcf_unique_id(serialize($field));
    $form['skypename'] = array('#type' => 'textfield', '#value' => isset($field['value']['skypename']) ? $field['value']['skypename'] : '', '#name' => 'wpcf[' . $field['slug'] . '][skypename]', '#id' => 'wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-skypename', '#inline' => true, '#suffix' => '&nbsp;' . __('Skype name', 'wpcf'), '#description' => '', '#prefix' => !empty($field['description']) ? wpcf_translate('field ' . $field['id'] . ' description', $field['description']) . '<br /><br />' : '', '#attributes' => array('style' => 'width:60%;'), '#_validate_this' => true, '#before' => '<div class="wpcf-skype">');
    $form['style'] = array('#type' => 'hidden', '#value' => isset($field['value']['style']) ? $field['value']['style'] : 'btn2', '#name' => 'wpcf[' . $field['slug'] . '][style]', '#id' => 'wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-style');
    $preview_skypename = !empty($field['value']['skypename']) ? $field['value']['skypename'] : '--not--';
    $preview_style = !empty($field['value']['style']) ? $field['value']['style'] : 'btn2';
    $preview = wpcf_fields_skype_get_button_image($preview_skypename, $preview_style);
    // Set button
    // TODO WPML move
    if (isset($field['disable']) || wpcf_wpml_field_is_copied($field)) {
        $edit_button = '';
    } else {
        $edit_button = '' . '<a href="' . admin_url('admin-ajax.php?action=wpcf_ajax&amp;' . 'wpcf_action=insert_skype_button&amp;_wpnonce=' . wp_create_nonce('insert_skype_button') . '&amp;update=wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '&amp;skypename=' . $preview_skypename . '&amp;button_style=' . $preview_style . '&amp;keepThis=true&amp;TB_iframe=true&amp;width=500&amp;height=500') . '"' . ' class="thickbox wpcf-fields-skype button-secondary"' . ' title="' . __('Edit Skype button', 'wpcf') . '"' . '>' . __('Edit Skype button', 'wpcf') . '</a>';
    }
    $form['markup'] = array('#type' => 'markup', '#markup' => '<div class="wpcf-form-item">' . '<div id="wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-preview">' . $preview . '</div>' . $edit_button . '</div>');
    $form['markup-close'] = array('#type' => 'markup', '#markup' => '</div>');
    return $form;
}
Example #21
0
 /**
  * Enqueue scripts and styles
  *
  * @return void
  */
 static function admin_enqueue_scripts()
 {
     parent::admin_enqueue_scripts();
     add_thickbox();
     wp_enqueue_script('media-upload');
     wp_enqueue_script('rwmb-thickbox-image', RWMB_JS_URL . 'thickbox-image.js', array('jquery'), RWMB_VER, true);
 }
 function render()
 {
     $css = $this->ctc()->css;
     $themes = $this->ctc()->themes;
     $child = $css->get_prop('child');
     $hidechild = count($themes['child']) ? '' : 'style="display:none"';
     $enqueueset = isset($css->enqueue) && $child;
     $this->ctc()->debug('Enqueue set: ' . ($enqueueset ? 'TRUE' : 'FALSE'), __FUNCTION__);
     if (empty($css->nowarn)) {
         $this->parent_theme_check();
     }
     $imports = $css->get_prop('imports');
     $id = 0;
     $this->ctc()->fs_method = get_filesystem_method();
     add_thickbox();
     add_filter('chld_thm_cfg_files_tab_filter', array($this, 'render_files_tab_options'));
     add_action('chld_thm_cfg_tabs', array($this, 'render_addl_tabs'), 10, 4);
     add_action('chld_thm_cfg_panels', array($this, 'render_addl_panels'), 10, 4);
     add_action('chld_thm_cfg_related_links', array($this, 'lilaea_plug'));
     if ($this->ctc()->is_debug) {
         $this->ctc()->debug('adding new debug action...', __FUNCTION__);
         add_action('chld_thm_cfg_print_debug', array($this->ctc(), 'print_debug'));
     }
     include CHLD_THM_CFG_DIR . '/includes/forms/main.php';
 }
Example #23
0
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 1.0.0
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, $data)
 {
     parent::setup($action, $data);
     add_thickbox();
     $this->admin_page->enqueue_script('list', array('jquery'), array('list' => array('shortcode_popup' => __('To embed this table into a post or page, use this Shortcode:', 'tablepress'), 'donation-message-already-donated' => __('Thank you very much! Your donation is highly appreciated. You just contributed to the further development of TablePress!', 'tablepress'), 'donation-message-maybe-later' => sprintf(__('No problem! I still hope you enjoy the benefits that TablePress adds to your site. If you should change your mind, you\'ll always find the &#8220;Donate&#8221; button on the <a href="%s">TablePress website</a>.', 'tablepress'), 'http://tablepress.org/'))));
     if ($data['messages']['first_visit']) {
         $this->add_header_message('<strong><em>' . __('Welcome!', 'tablepress') . '</em></strong><br />' . __('Thank you for using TablePress for the first time!', 'tablepress') . ' ' . sprintf(__('If you encounter any questions or problems, please visit the <a href="%1$s">FAQ</a>, the <a href="%2$s">documentation</a>, and the <a href="%3$s">Support</a> section on the <a href="%4$s">plugin website</a>.', 'tablepress'), 'http://tablepress.org/faq/', 'http://tablepress.org/documentation/', 'http://tablepress.org/support/', 'http://tablepress.org/') . '<br /><br />' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'first_visit', 'return' => 'list'), __('Hide this message', 'tablepress')));
     }
     if ($data['messages']['wp_table_reloaded_warning']) {
         $this->add_header_message('<strong><em>' . __('Attention!', 'tablepress') . '</em></strong><br />' . __('You have activated the plugin WP-Table Reloaded, which can not be used together with TablePress.', 'tablepress') . '<br />' . __('It is strongly recommended that you switch from WP-Table Reloaded to TablePress, which not only fixes many problems, but also has more and better features than WP-Table Reloaded.', 'tablepress') . '<br />' . sprintf(__('Please follow the <a href="%s">migration guide</a> to move your tables and then deactivate WP-Table Reloaded!', 'tablepress'), 'http://tablepress.org/migration-from-wp-table-reloaded/') . '<br />' . '<a href="' . TablePress::url(array('action' => 'import')) . '" class="button button-primary button-large" title="' . __('Import your tables from WP-Table Reloaded', 'tablepress') . '" style="color:#ffffff;margin-top:5px;">' . __('Import your tables from WP-Table Reloaded', 'tablepress') . '</a>', 'error');
     }
     if ($data['messages']['donation_message']) {
         $this->add_header_message('<img alt="' . __('Tobias Bäthge, developer of TablePress', 'tablepress') . '" src="https://secure.gravatar.com/avatar/50f1cff2e27a1f522b18ce229c057bc5?s=94" height="94" width="94" style="float:left;margin-right:10px;" />' . __('Hi, my name is Tobias, I\'m the developer of the TablePress plugin.', 'tablepress') . '<br /><br />' . __('Thanks for using it! You\'ve installed TablePress over a month ago.', 'tablepress') . ' ' . sprintf(_n('If everything works and you are satisfied with the results of managing your %s table, isn\'t that worth a coffee or two?', 'If everything works and you are satisfied with the results of managing your %s tables, isn\'t that worth a coffee or two?', $data['table_count'], 'tablepress'), $data['table_count']) . '<br/>' . sprintf(__('<a href="%s">Donations</a> help me to continue user support and development of this <em>free</em> software &mdash; things for which I spend countless hours of my free time! Thank you very much!', 'tablepress'), 'http://tablepress.org/donate/') . '<br/><br />' . __('Sincerly, Tobias', 'tablepress') . '<br /><br />' . sprintf('<a href="%s" target="_blank"><strong>%s</strong></a>', 'http://tablepress.org/donate/', __('Sure, I\'ll buy you a coffee and support TablePress!', 'tablepress')) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'already-donated'), __('I already donated.', 'tablepress')) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'maybe-later'), __('No, thanks. Don\'t ask again.', 'tablepress')));
     }
     if ($data['messages']['show_plugin_update']) {
         $message = '<strong><em>' . sprintf(__('Thank you for updating to TablePress %s!', 'tablepress'), TablePress::version) . '</em></strong><br />';
         if (!empty($data['messages']['plugin_update_message'])) {
             $message .= $data['messages']['plugin_update_message'] . '<br />';
         }
         $message .= sprintf(__('Please read the <a href="%s">release announcement</a> for more information.', 'tablepress'), 'http://tablepress.org/news/') . ' ' . sprintf(__('If you like the new features and enhancements, <a href="%s">giving a donation</a> towards the further support and development of TablePress is recommended. Thank you!', 'tablepress'), 'http://tablepress.org/donate/') . '<br /><br />';
         $message .= $this->ajax_link(array('action' => 'hide_message', 'item' => 'plugin_update', 'return' => 'list'), __('Hide this message', 'tablepress'));
         $this->add_header_message($message);
     }
     $this->process_action_messages(array('success_delete' => _n('The table was deleted successfully.', 'The tables were deleted successfully.', 1, 'tablepress'), 'success_delete_plural' => _n('The table was deleted successfully.', 'The tables were deleted successfully.', 2, 'tablepress'), 'error_delete' => __('Error: The table could not be deleted.', 'tablepress'), 'error_save' => __('Error: The table could not be saved.', 'tablepress'), 'success_copy' => _n('The table was copied successfully.', 'The tables were copied successfully.', 1, 'tablepress'), 'success_copy_plural' => _n('The table was copied successfully.', 'The tables were copied successfully.', 2, 'tablepress'), 'error_copy' => __('Error: The table could not be copied.', 'tablepress'), 'error_no_table' => __('Error: You did not specify a valid table ID.', 'tablepress'), 'error_load_table' => __('Error: This table could not be loaded!', 'tablepress'), 'error_bulk_action_invalid' => __('Error: This bulk action is invalid!', 'tablepress'), 'error_no_selection' => __('Error: You did not select any tables!', 'tablepress'), 'error_delete_not_all_tables' => __('Notice: Not all selected tables could be deleted!', 'tablepress'), 'error_copy_not_all_tables' => __('Notice: Not all selected tables could be copied!', 'tablepress'), 'success_import' => __('The tables were imported successfully.', 'tablepress'), 'success_import_wp_table_reloaded' => __('The tables were imported successfully from WP-Table Reloaded.', 'tablepress')));
     $this->add_text_box('head', array($this, 'textbox_head'), 'normal');
     $this->add_text_box('tables-list', array($this, 'textbox_tables_list'), 'normal');
     add_screen_option('per_page', array('label' => __('Tables', 'tablepress'), 'default' => 20));
     // Admin_Controller contains function to allow changes to this in the Screen Options to be saved
     $this->wp_list_table = new TablePress_All_Tables_List_Table();
     $this->wp_list_table->set_items($this->data['tables']);
     $this->wp_list_table->prepare_items();
     // cleanup Request URI string, which WP_List_Table uses to generate the sort URLs
     $_SERVER['REQUEST_URI'] = remove_query_arg(array('message', 'table_id'), $_SERVER['REQUEST_URI']);
 }
 /**
  * Enqueues thickbox scripts/styles for plugin info.
  *
  * Thickbox is not automatically included on all admin pages, so we must
  * manually enqueue it for those pages.
  *
  * Thickbox is only loaded if the user has not dismissed the admin
  * notice
  *
  * @since 1.0.0
  */
 public function thickbox()
 {
     if ($this->notice_dismissed()) {
         return;
     }
     add_thickbox();
 }
 /**
  * view function
  *
  * @return void
  **/
 public function view()
 {
     global $ai1ec_view_helper, $ai1ec_settings, $ct;
     // defaults
     $activated = false;
     $deleted = false;
     // check if action is set
     if (isset($_GET['action']) && !empty($_GET['action'])) {
         // action can activate or delete a theme
         switch ($_GET['action']) {
             // activate theme
             case 'activate':
                 $activated = $this->activate_theme();
                 break;
                 // delete theme
             // delete theme
             case 'delete':
                 $deleted = $this->delete_theme();
                 break;
         }
     }
     if ($activated) {
         Ai1ec_Less_Factory::set_active_theme_path(AI1EC_THEMES_ROOT . DIRECTORY_SEPARATOR . $_GET['ai1ec_template']);
         $this->generate_notice_if_legacy_theme_installed(true);
     }
     $_list_table = new Ai1ec_Themes_List_Table();
     $_list_table->prepare_items();
     $args = array('activated' => $activated, 'deleted' => $deleted, 'ct' => $ct, 'wp_list_table' => $_list_table, 'page_title' => __('All-in-One Event Calendar: Themes', AI1EC_PLUGIN_NAME));
     add_thickbox();
     wp_enqueue_script('theme-preview');
     $ai1ec_view_helper->display_admin('themes.php', $args);
 }
Example #26
0
 function load_scripts()
 {
     wp_enqueue_script('gwa-user', AGM_PLUGIN_URL . '/js/gwa-user.js');
     if (bp_is_activity_component()) {
         add_thickbox();
     }
 }
Example #27
0
/**
 * Network Settings page for plugin
 * 
 * Display and Process Settings page for this plugin.
 *
 */
function jr_ps_network_settings_page()
{
    global $jr_ps_plugin_data;
    add_thickbox();
    echo '<div class="wrap">';
    screen_icon('plugins');
    echo '<h2>' . $jr_ps_plugin_data['Name'] . '</h2>';
    ?>
	<p>
	This Plugin has been <b>Network Activated</b> in a WordPress Multisite ("Network") installation.
	Since all of this plugin's Settings can be specified separately for each individual WordPress site,
	you will need to go to the Admin pages for each Site,
	and review the plugin's Settings page,
	making changes appropriate for that Site.
	The plugin's Settings page can be found by opening the <b>Settings</b> submenu on the left sidebar of each Admin page for the Site
	and selecting <b>Private Site</b>.
	Or from the <b>Settings</b> link in the plugin's entry on the <b>Installed Plugins</b> page for the Site
	<i>(WordPress does not list Network Activated plugins on each Site's Installed Plugins page,
	but this plugin has added its own entry for your convenience)</i>.
	</p>
	<p>
	Alternatively, you can <b>Network Deactivate</b> this plugin
	and <b>Activate</b> it individually on each Site where you wish to use it.
	</p>
	<p>
	If you would prefer, when this plugin is Network Activated,
	to have a single set of Settings that would apply to all Sites in a WordPress network,
	and/or be able to view and change all of the Settings for all Sites from this one Network Settings page that you are now viewing,
	<a href="http://zatzlabs.com/contact-us/">please contact the Plugin author</a>
	and this will be added to a future version of this plugin if there is enough interest expressed by webmasters such as you.
	</p>
	<?php 
}
Example #28
0
function simplepopup_enqueue_editor()
{
    wp_enqueue_script('common');
    wp_enqueue_script('jquery-affect');
    wp_admin_css('thickbox');
    wp_print_scripts('post');
    wp_print_scripts('media-upload');
    wp_print_scripts('jquery');
    wp_print_scripts('jquery-ui-core');
    wp_print_scripts('jquery-ui-tabs');
    wp_print_scripts('tiny_mce');
    wp_print_scripts('editor');
    wp_print_scripts('editor-functions');
    /* Include thе link dialog functions */
    require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
    wp_print_scripts('wplink');
    wp_print_styles('wplink');
    add_action('tiny_mce_preload_dialogs', 'wp_link_dialog');
    add_thickbox();
    wp_tiny_mce();
    wp_admin_css();
    wp_enqueue_script('utils');
    do_action("admin_print_styles-post-php");
    do_action('admin_print_styles');
    //remove_all_filters('mce_external_plugins');
}
Example #29
0
/**
 * Defines an array of options that will be used to generate the settings page and be saved in the database.
 * When creating the 'id' fields, make sure to use all lowercase and no spaces.
 *
 */
function optionsframework_options()
{
    $shortname = 'klasik';
    $optLogotype = array('imagelogo' => __('Image logo', 'klasik'), 'textlogo' => __('Text-based logo', 'klasik'));
    $optArrSlider = array('ASC' => 'Ascending', 'DESC' => 'Descending');
    // Footer Column
    $options_footcolumn = array('1' => '1 Column', '2' => '2 Column', '3' => '3 Column', '4' => '4 Column', '5' => '5 Column', '6' => '6 Column');
    // Background Defaults
    $background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat', 'position' => 'top center', 'attachment' => 'scroll');
    $optBackgroundStyle = array('repeat' => "Repeat", 'repeat-x' => "Repeat Horizontal", 'repeat-y' => "Repeat Vertical", 'no-repeat' => "No Repeat", 'fixed' => "Fixed");
    $optBackgroundPosition = array('left' => "Left", 'center' => "Center", 'right' => "Right", 'top left' => "Top", 'top center' => "Top Center", 'top right' => "Top Right", 'bottom left' => "Bottom", 'bottom center' => "Bottom Center", 'bottom right' => "Bottom Right");
    // Pull all the categories into an array
    $options_categories = array();
    $options_categories_obj = get_categories();
    $options_categories["allcategories"] = __('Select The Category', 'klasik');
    foreach ($options_categories_obj as $category) {
        $options_categories[$category->slug] = $category->cat_name;
    }
    // Pull all the pages into an array
    $options_pages = array();
    $options_pages_obj = get_pages('sort_column=post_parent,menu_order');
    $options_pages[''] = 'Select a page:';
    foreach ($options_pages_obj as $page) {
        $options_pages[$page->ID] = $page->post_title;
    }
    // If using image radio buttons, define a directory path
    $imagepath = get_template_directory_uri() . '/images/';
    $options = array();
    $options[] = array('name' => __('General', 'klasik'), 'type' => 'heading');
    $options[] = array('name' => __('Disable Responsive', 'klasik'), 'desc' => __('Select this checkbox to disable responsive feature.', 'klasik'), 'id' => $shortname . "_disable_responsive", 'std' => '0', 'type' => 'checkbox');
    if (file_exists(get_stylesheet_directory() . '/rtl.css')) {
        $options[] = array('name' => __('Enable RTL Language Support', 'klasik'), 'desc' => __('Select this checkbox to enable RTL Language Support.', 'klasik'), 'id' => $shortname . "_enable_rtl", 'std' => '0', 'type' => 'checkbox');
    }
    if (file_exists(get_stylesheet_directory() . '/fixedmenu.css')) {
        $options[] = array('name' => __('Enable Fixed Menu', 'klasik'), 'desc' => __('Select this checkbox to enable fixed menu.', 'klasik'), 'id' => $shortname . "_enable_fixed_menu", 'std' => '0', 'type' => 'checkbox');
    }
    $options[] = array('name' => __('Disable Homepage Slider', 'klasik'), 'desc' => __('Select this checkbox to disable homepage slider feature.', 'klasik'), 'id' => $shortname . "_disable_slider", 'std' => '0', 'type' => 'checkbox');
    $options[] = array('name' => __('Default Layout', 'klasik'), 'desc' => __('Select the default layout for your theme.', 'klasik'), 'id' => $shortname . "_sidebar_position", 'std' => 'two-col-left', 'type' => 'images', 'options' => array('one-col' => $imagepath . '1col.png', 'two-col-left' => $imagepath . '2cl.png', 'two-col-right' => $imagepath . '2cr.png'));
    $options[] = array('name' => __('Header', 'klasik'), 'type' => 'heading');
    $options[] = array('name' => __('Logo Type', 'klasik'), 'desc' => __('If text-based logo is activated, enter the sitename and tagline in the fields below.', 'klasik'), 'id' => $shortname . "_logo_type", 'std' => 'imagelogo', 'type' => 'select', 'class' => 'mini', 'options' => $optLogotype);
    $options[] = array('name' => __('Site name', 'klasik'), 'desc' => __('Put your sitename in here.', 'klasik'), 'id' => $shortname . "_site_name", 'std' => '', 'type' => 'text');
    $options[] = array('name' => __('Tagline', 'klasik'), 'desc' => __('Put your tagline in here.', 'klasik'), 'id' => $shortname . "_tagline", 'std' => '', 'type' => 'text');
    $options[] = array('name' => __('Logo Image', 'klasik'), 'desc' => __('If image logo is activated, upload the logo image.', 'klasik'), 'id' => $shortname . "_logo_image", 'type' => 'upload');
    $options[] = array('name' => __('Favicon', 'klasik'), 'desc' => __('Upload the favicon image.', 'klasik'), 'id' => $shortname . "_favicon", 'type' => 'upload');
    $options[] = array('name' => __('Footer', 'klasik'), 'type' => 'heading');
    $options[] = array('name' => __('Footer Column', 'klasik'), 'desc' => __('The value is column for display in footer column.', 'klasik'), 'id' => $shortname . "_foot_column", 'std' => '3', 'type' => 'select', 'class' => 'mini', 'options' => $options_footcolumn);
    $options[] = array('name' => __('Footer Text', 'klasik'), 'desc' => __('You can use html tag in here.', 'klasik'), 'id' => $shortname . "_footer", 'std' => '', 'type' => 'textarea');
    $options[] = array('name' => __('Footer Script', 'klasik'), 'desc' => __('Enter your footer script here.', 'klasik'), 'id' => $shortname . "_footerscript", 'std' => '', 'type' => 'textarea');
    $options[] = array('name' => __('Custom Styling', 'klasik'), 'type' => 'heading');
    add_thickbox();
    if (file_exists(get_stylesheet_directory() . '/color.css')) {
        $thecolorfile = get_stylesheet_directory_uri() . '/color.css';
    } else {
        $thecolorfile = get_stylesheet_directory_uri() . '/css/color.css';
    }
    $options[] = array('name' => __('Custom CSS', 'klasik'), 'desc' => __('Enter your custom css here. <br/> <strong>You can see the original styles to override it :</strong>', 'klasik') . ' <a href="' . $thecolorfile . '?iframe=true&width=950&height=600" class="useprettyphoto">color.css</a>', 'id' => $shortname . "_customcss", 'std' => '', 'type' => 'textarea');
    $options = apply_filters('klasik_optionsframework_options', $options);
    return $options;
}
Example #30
-1
/**
 * Form data for post edit page.
 * 
 * @param type $field 
 */
function wpcf_fields_file_meta_box_form($field, $image = false)
{
    add_thickbox();
    $type = $image ? 'image' : 'file';
    $button_text = $image ? __('Upload image', 'wpcf') : __('Upload file', 'wpcf');
    // Get attachment by guid
    global $wpdb;
    $attachment_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts}\r\r\n    WHERE post_type = 'attachment' AND guid=%s", $field['value']));
    // Set preview
    $preview = '';
    if (!empty($attachment_id)) {
        $preview = wp_get_attachment_image($attachment_id, 'thumbnail');
    } else {
        // If external image set preview
        $file = pathinfo($field['value']);
        if (isset($file['extension']) && in_array($file['extension'], array('jpg', 'jpeg', 'gif', 'png'))) {
            $preview = '<img alt="" src="' . $field['value'] . '" />';
        }
    }
    // Set button
    if (!empty($field['#attributes']['readonly']) || !empty($field['#attributes']['disabled'])) {
        $button = '';
    } else {
        $button = '<a href="javascript:void(0);"' . ' class="wpcf-fields-' . $type . '-upload-link button-secondary"' . ' id="wpcf-fields-' . $field['slug'] . '-upload">' . $button_text . '</a>';
    }
    // Set form
    $form = array('#type' => 'textfield', '#id' => 'wpcf-fields-' . $field['slug'] . '-upload-holder', '#name' => 'wpcf[' . $field['slug'] . ']', '#suffix' => '&nbsp;' . $button, '#after' => '<div id="wpcf-fields-' . $field['slug'] . '-upload-holder-preview"' . ' class="wpcf-fields-file-preview">' . $preview . '</div>', '#attributes' => array('class' => 'wpcf-fields-file-textfield'));
    return $form;
}