Shortcode metabox
@return void
517797
public function shortcodeMetabox()
    {
        if (empty(self::$enabled)) {
            return;
        }

        add_meta_box('modularity-shortcode', 'Modularity Shortcode', function () {
            global $post;
            echo '<p>';
            echo __('Copy and paste this shortcode to display the module inline.', 'modularity');
            echo '</p><p>';
            echo '<label><input type="checkbox" class="modularity-inline-template" checked> Use inline template</label>';
            echo '<textarea style="margin-top:10px; overflow: hidden;width: 100%;height:30px;background:#f9f9f9;border:1px solid #ddd;padding:5px;">[modularity id="' . $post->ID . '"]</textarea>';
            echo '</p>';

            echo "<script>
                jQuery(document).ready(function ($) {
                    $('.modularity-inline-template').prop('checked', true);

                    $('.modularity-inline-template').on('change', function () {
                        if ($(this).prop('checked') == false) {
                            $(this).parents('.inside').find('pre span').text(' inline=\"false\"');
                        } else {
                            $(this).parents('.inside').find('pre span').text('');
                        }
                    });
                });
            </script>";
        }, self::$enabled, 'side', 'default');
    }
882483
public function register()
    {
        if ($this->hasShortcodes()) {
            foreach ($this->shortcodes as $shortcode => $methodName) {
                if (method_exists($this->controller, $methodName)) {
                    add_shortcode($this->formatCode($shortcode), array($this->controller, $methodName));
                }
            }
        }
    }
472295
protected function loadShortCodes()
    {
        if ($config = $this->loadConfigFile('shortcodes.php')) {
            $renderer = $this->renderer;
            $app      = $this->app;

            foreach ($config as $shortcode => $provider) {
                add_shortcode($shortcode, function ($attrs, $content) use ($app, $provider, $renderer)
                {
                    if (is_string($provider) && is_subclass_of($provider, 'Tev\Plugin\Shortcode\AbstractProvider')) {
                        $sp = new $provider($app, $renderer);
                        return $sp->shortcode($attrs, $content);
                    } elseif ($provider instanceof Closure) {
                        return $provider($attrs, $content, $renderer);
                    }
                });
            }
        }

        return $this;
    }
512245
public function mediaShortCodeHandler( $atts, $content, $shortcode ) {
		global $wp_embed;
		$atts = shortcode_atts(
			[
				'caption' => null,
				'src' => null,
			], $atts
		);
		$src = $atts['src'] ?? $content;
		if ( str_starts_with( $src, '“' ) || str_starts_with( $src, '”' ) || str_starts_with( $src, '‘' ) || str_starts_with( $src, '’' ) ) {
			$src = trim( $src, '“”‘’' ); // Trim fancy quotes, for MS-Word compatibility
		}
		$src = esc_url_raw( $src );
		if ( ! filter_var( $src, FILTER_VALIDATE_URL ) ) {
			return '';
		}
		// Can't use `do_shortcode_by_tags` because the default callback for 'embed' is `__return_false` - @see \WP_Embed::__construct
		$e = $wp_embed->run_shortcode( sprintf( '[embed src="%s"]', $src ) );
		if ( $atts['caption'] ) {
			return sprintf(
				'<figure class="embed">%1$s<figcaption>%2$s</figcaption></figure>',
				str_replace( [ '<p>', '</p>' ], '', $e ),
				$atts['caption']
			);
		} else {
			return $e;
		}
	}
6127
public function setPremiumSms($shortcode, $keyword, $tariff, $mid = null, $member = null)
    {
        $this->typeDetails['shortcode'] = $shortcode;
        $this->typeDetails['keyword']   = $keyword;
        $this->typeDetails['tariff']    = $tariff;
        if ($mid != null) {
            $this->typeDetails['mid'] = $mid;
        }
        if ($member != null) {
            $this->typeDetails['member'] = $member;
        }

        $this->type = self::TYPE_PREMIUM;
    }
359677
function mf_metabox_content( $post, $metabox ) {
    global $mf_domain, $mf_post_values;

    //Getting the custom fields for this metabox
    $custom_fields = $this->get_custom_fields_by_group($metabox['args']['group_info']['id']);
    $group_id = $metabox['args']['group_info']['id'];
    //default markup
    ?>
    <div class="mf-group-wrapper group-<?php print $group_id;?>" id="mf_group-<?php print $group_id; ?>" >
      <!-- grupos se puede repetir -->
      <?php
        $extraclass = "";
        if( $metabox['args']['group_info']['duplicated'] ) {
          $extraclass = "mf_duplicate_group";
          $repeated_groups = $this->mf_get_duplicated_groups( $post->ID, $group_id );
        } else {
          $repeated_groups = 1;
        }

        for( $group_index = 1; $group_index <= $repeated_groups; $group_index++ ){
          $only = ($repeated_groups == 1)? TRUE : FALSE;
          $this->mf_draw_group($metabox,$extraclass,$group_index,$custom_fields,$mf_post_values,$only);
        }
        printf('<input value="%d" id="mf_group_counter_%d" style="display:none" >',$repeated_groups,$group_id);
      ?>
      <!-- fin del grupo -->
    </div>
  <?php
  }
104121
protected function saveMetas()
    {
        $metas = '<?php return '.var_export($this->metas->getAll(), true).';';
        file_put_contents($this->getMetaFile(), $metas);
    }
1043356
public function minifyHTML(){
        $buffer = $this->response->getContent();
        if(strpos($buffer,'<pre>') !== false)
        {
            $replace = array(
                '/<!--[^\[](.*?)[^\]]-->/s' => '',
                "/<\?php/"                  => '<?php ',
                "/\r/"                      => '',
                "/>\n</"                    => '><',
                "/>\s+\n</"    				=> '><',
                "/>\n\s+</"					=> '><',
            );
        }
        else
        {
            $replace = array(
                '/<!--[^\[](.*?)[^\]]-->/s' => '',
                "/<\?php/"                  => '<?php ',
                "/\n([\S])/"                => '$1',
                "/\r/"                      => '',
                "/\n/"                      => '',
                "/\t/"                      => '',
                "/ +/"                      => ' ',
                '#^\s*//.+$#m'              => '', // remove single comment in JS
            );
        }
        $buffer = preg_replace(array_keys($replace), array_values($replace), $buffer);
        $this->response->setContent($buffer);
    }
497205
function shortCode( $_atts, $latex ) {
		$atts = shortcode_atts( array(
		    'size' => 0,
		    'color' => false,
		    'background' => false,
			), $_atts );

		$latex = preg_replace( array( '#<br\s*/?>#i', '#</?p>#i' ), ' ', $latex );

		$latex = str_replace(
			array( '&lt;', '&gt;', '&quot;', '&#8220;', '&#8221;', '&#039;', '&#8125;', '&#8127;', '&#8217;', '&#038;', '&amp;', "\n", "\r", "\xa0", '&#8211;' ),
			array( '<',    '>',    '"',      '``',       "''",     "'",      "'",       "'",       "'",       '&',      '&',     ' ',  ' ',  ' ',    '-' ),
			$latex
		);

		$latex_object = $this->latex( $latex, $atts['background'], $atts['color'], $atts['size'] );

		$url = esc_url( $latex_object->url );
		$alt = esc_attr( is_wp_error( $latex_object->error ) ? $latex_object->error->get_error_message() . ": $latex_object->latex" : $latex_object->latex  );

		return "<img src='$url' alt='$alt' title='$alt' class='latex' />";
	}
872695
public function enableCompiler()
    {
        // Check if the compiler is auto enabled
        $state = $this->app['config']->get('laravel-shortcodes::enabled', false);

        // Enable when needed
        if ($state) {
            $this->app['shortcode.compiler']->enable();
        }
    }
793093
public function register( $context = null ) {
		if ( ! $this->is_needed() ) {
			return;
		}

		\shortcode_ui_register_for_shortcode(
			$this->shortcode_tag,
			$this->config
		);
	}
127772
public function render_metaboxes_custom( $post, $args ) {

		// include the metabox view
		echo '<input type="hidden" name="pods_templates_metabox" id="pods_templates_metabox" value="' . esc_attr( wp_create_nonce( plugin_basename( __FILE__ ) ) ) . '" />';
		echo '<input type="hidden" name="pods_templates_metabox_prefix[]" value="' . esc_attr( $args['args']['slug'] ) . '" />';

		// get post meta to $atts $ post content - ir the widget option
		if ( ! empty( $post ) ) {
			$atts    = get_post_meta( $post->ID, $args['args']['slug'], true );
			$content = $post->post_content;
		} else {
			$atts    = get_option( $args['args']['slug'] );
			$content = '';
		}

		if ( file_exists( $this->get_path( __FILE__ ) . 'includes/element-' . $args['args']['slug'] . '.php' ) ) {
			include $this->get_path( __FILE__ ) . 'includes/element-' . $args['args']['slug'] . '.php';
		} elseif ( file_exists( $this->get_path( __FILE__ ) . 'includes/element-' . $args['args']['slug'] . '.html' ) ) {
			include $this->get_path( __FILE__ ) . 'includes/element-' . $args['args']['slug'] . '.html';
		}
		// add script
		if ( file_exists( $this->get_path( __FILE__ ) . 'assets/js/scripts-' . $args['args']['slug'] . '.php' ) ) {
			echo "<script type=\"text/javascript\">\r\n";
			include $this->get_path( __FILE__ ) . 'assets/js/scripts-' . $args['args']['slug'] . '.php';
			echo "</script>\r\n";
		} elseif ( file_exists( $this->get_path( __FILE__ ) . 'assets/js/scripts-' . $args['args']['slug'] . '.js' ) ) {
			wp_enqueue_script( $this->plugin_slug . '-' . $args['args']['slug'] . '-script', $this->get_url( 'assets/js/scripts-' . $args['args']['slug'] . '.js', __FILE__ ), array( 'jquery' ), self::VERSION, true );
		}

	}
307488
public function metaKeywordString()
    {
        $tagKeywords = array_map(
        function( $tag )
            {
                /** @var eZTagsObject $tag */
                return $tag->attribute( 'keyword' );
            },
            $this->tags()
        );

        return !empty( $tagKeywords ) ? implode( ', ', $tagKeywords ) : '';
    }
791083
public function descriptionMetabox()
    {
        if (empty(self::$enabled)) {
            return;
        }

        add_meta_box(
            'modularity-description',
            __('Module description', 'modularity'),
            function () {
                $description = get_post_meta(get_the_id(), 'module-description', true);
                include MODULARITY_TEMPLATE_PATH . 'editor/modularity-module-description.php';
            },
            self::$enabled,
            'normal',
            'high'
        );
    }
1366004
public function metaboxGet(int $post_id)
    {
        $value = get_post_meta($post_id, $this->getName(), ! $this->getOption('multiple', false));

        if (! empty($value)) {
            $this->setValue($value);
        }
    }
228388
protected function configure()
    {
        $this->setDescription($this->shortDesc);

        foreach($this->paramsArray as $nameParam => $arrayOptions){
            if($arrayOptions['optional']){
                $this->addOption($nameParam, null, InputOption::VALUE_OPTIONAL, $arrayOptions['comment'], null);
            }
            else {
                $this->addOption($nameParam, null, InputOption::VALUE_REQUIRED, $arrayOptions['comment'], null);
            } 
        }
    }
968226
public function add_meta_boxes( $post_type )
    {    
        if ( in_array( $post_type, $this->settings['post_types'] )) {
            add_meta_box(
                $this->settings['id'],
                $this->settings['title'],
                array( $this, 'render' ),
                $post_type,
                $this->settings['context'],
                $this->settings['priority']
            );
        }
    }