Exemplo n.º 1
0
 public static function init()
 {
     // Hotfix for NextGEN Gallery plugin
     if (defined('NGG_PLUGIN_VERSION')) {
         add_filter('elementor/utils/get_edit_link', function ($edit_link) {
             return add_query_arg('display_gallery_iframe', '', $edit_link);
         });
     }
     // Hack for Ninja Forms
     if (class_exists('\\Ninja_Forms')) {
         add_action('elementor/preview/enqueue_styles', function () {
             ob_start();
             \NF_Display_Render::localize(0);
             ob_clean();
             wp_add_inline_script('nf-front-end', 'var nfForms = nfForms || [];');
         });
     }
     // Exclude our Library from sitemap.xml in Yoast SEO plugin
     add_filter('wpseo_sitemaps_supported_post_types', function ($post_types) {
         unset($post_types[TemplateLibrary\Source_Local::CPT]);
         return $post_types;
     });
     // Disable optimize files in Editor from Autoptimize plugin
     add_filter('autoptimize_filter_noptimize', function ($retval) {
         if (Plugin::instance()->editor->is_edit_mode()) {
             $retval = true;
         }
         return $retval;
     });
 }
Exemplo n.º 2
0
 /**
  * Display Wrapper
  *
  * @param $form_id
  */
 public function display($form_id, $preview = FALSE)
 {
     if (!$form_id) {
         return;
     }
     $noscript_message = __('Notice: JavaScript is required for this content.', 'ninja-forms');
     $noscript_message = apply_filters('ninja_forms_noscript_message', $noscript_message);
     Ninja_Forms()->template('display-noscript-message.html.php', array('message' => $noscript_message));
     if (!$preview) {
         NF_Display_Render::localize($form_id);
     } else {
         NF_Display_Render::localize_preview($form_id);
     }
 }