Register shortcode

@param array $attributes
@return void
175829
public function _shortcode( $attributes ) {
		if ( ! isset( $attributes['post_id'] ) ) {
			return;
		}

		$attributes = shortcode_atts(
			[
				'type'    => 'balloon',
				'post_id' => '',
			],
			$attributes
		);

		if ( 'official' === $attributes['type'] ) {
			$file = 'official';
		} else {
			$file = 'pinterest';
		}

		return $this->render(
			'pinterest/' . $file,
			[
				'type'    => $attributes['type'],
				'post_id' => $attributes['post_id'],
			]
		);
	}
547875
public function addAttributes(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            $this->addAttribute($key, $value);
        }
    }
819978
public static function setup($byType, array $attributes)
    {
        if (0 !== preg_match('#^(' . self::$alloweds . '|select|form)$#', $type)) {
            self::$preAttrs[$byType] = $attributes;
        }
    }
122381
public function _shortcode( $attributes ) {
		if ( ! isset( $attributes['post_id'] ) ) {
			return;
		}

		$attributes = shortcode_atts(
			[
				'type'    => 'balloon',
				'post_id' => '',
			],
			$attributes
		);

		if ( 'official' === $attributes['type'] ) {
			$file = 'official';
		} else {
			$file = 'feedly';
		}

		if ( function_exists( 'scc_get_follow_feedly' ) ) {
			$has_cache  = true;
			$expiration = null;
			$count      = scc_get_follow_feedly();
		} else {
			$count_cache = new Count_Cache( $attributes['post_id'], 'feedly' );
			$has_cache   = $count_cache->is_enabled();
			$expiration  = $count_cache->get_cache_expiration();
			$cache       = $count_cache->get();
			$count       = ( ! is_null( $cache ) ) ? $cache : '-';
		}

		return $this->render(
			'feedly/' . $file,
			[
				'type'       => $attributes['type'],
				'post_id'    => $attributes['post_id'],
				'has_cache'  => $has_cache,
				'expiration' => $expiration,
				'count'      => $count,
			]
		);
	}
640692
public function matchHeaders($attributes)
    {
        $attributes = (array) $attributes;
        foreach ($attributes as $key => $regexp) {
            $this->matchHeader($key, $regexp);
        }
    }
185975
public function setAttributes($attributes) {
        $this->setVariable(self::ATTRIBUTES, "");
        foreach($attributes as $name => $value) {
            $this->addAttribute($name, $value);
        }
    }
108341
protected function addShortLabels(array $languages)
    {
        foreach ($languages as $key => $val) {
            if (!array_key_exists('short_label', $val) || !$val['short_label']) {
                $languages[ $key ]['short_label'] = substr(strtoupper($val['label']), 0, 2);
            }
        }

        return $languages;
    }
1362545
public function tr(array $attributes = []): void
    {
        $this->trArray[] = Tags::tr($this->tdArray, $attributes);
        $this->tdArray = [];
    }
253096
public function fill(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            if (array_search($key, $this->fillable) !== false) {
                $this->{$key} = $value;
            }
        }
    }
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));
                }
            }
        }
    }
961067
public function register( $context = null ) {
		if ( null !== $context ) {
			$this->add_context( $context );
		}

		if ( ! $this->is_needed( $this->context ) ) {
			return;
		}

		\add_shortcode( $this->get_tag(), [ $this, 'render' ] );
	}
861313
public function register_assets() {

		$maybe_min = SCRIPT_DEBUG ? '' : '.min';

		wp_register_script( 'pods-json', PODS_URL . 'ui/js/jquery.json.js', array( 'jquery' ), '2.3' );

		if ( ! wp_script_is( 'jquery-qtip2', 'registered' ) ) {
			wp_register_script( 'jquery-qtip2', PODS_URL . 'ui/js/jquery.qtip.min.js', array( 'jquery' ), '2.2' );
		}

		wp_register_script(
			'pods', PODS_URL . 'ui/js/jquery.pods.js', array(
				'jquery',
				'pods-dfv',
				'pods-i18n',
				'pods-json',
				'jquery-qtip2',
			), PODS_VERSION, true
		);

		wp_register_script( 'pods-cleditor', PODS_URL . 'ui/js/jquery.cleditor.min.js', array( 'jquery' ), '1.3.0' );

		wp_register_script( 'pods-codemirror', PODS_URL . 'ui/js/codemirror.js', array(), '4.8', true );
		wp_register_script( 'pods-codemirror-loadmode', PODS_URL . 'ui/js/codemirror/addon/mode/loadmode.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-overlay', PODS_URL . 'ui/js/codemirror/addon/mode/overlay.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-hints', PODS_URL . 'ui/js/codemirror/addon/mode/show-hint.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-mode-xml', PODS_URL . 'ui/js/codemirror/mode/xml/xml.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-mode-html', PODS_URL . 'ui/js/codemirror/mode/htmlmixed/htmlmixed.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-mode-css', PODS_URL . 'ui/js/codemirror/mode/css/css.js', array( 'pods-codemirror' ), '4.8', true );

		if ( ! wp_script_is( 'jquery-ui-slideraccess', 'registered' ) ) {
			// No need to add dependencies. All managed by jquery-ui-timepicker.
			wp_register_script( 'jquery-ui-slideraccess', PODS_URL . 'ui/js/timepicker/jquery-ui-sliderAccess.js', array(), '0.3' );
		}

		if ( ! wp_script_is( 'jquery-ui-timepicker', 'registered' ) ) {
			wp_register_script(
				'jquery-ui-timepicker', PODS_URL . 'ui/js/timepicker/jquery-ui-timepicker-addon.min.js', array(
					'jquery',
					'jquery-ui-core',
					'jquery-ui-datepicker',
					'jquery-ui-slider',
					'jquery-ui-slideraccess',
				), '1.6.3'
			);
		}
		if ( ! wp_style_is( 'jquery-ui-timepicker', 'registered' ) ) {
			wp_register_style( 'jquery-ui-timepicker', PODS_URL . 'ui/js/timepicker/jquery-ui-timepicker-addon.min.css', array(), '1.6.3' );
		}

		wp_register_script(
			'pods-select2', PODS_URL . "ui/js/selectWoo/selectWoo{$maybe_min}.js", array(
				'jquery',
				'pods-i18n',
			), '1.0.1'
		);
		wp_register_style( 'pods-select2', PODS_URL . "ui/js/selectWoo/selectWoo{$maybe_min}.css", array(), '1.0.2' );

		// Marionette dependencies for MV fields
		wp_register_script( 'backbone.radio', PODS_URL . 'ui/js/marionette/backbone.radio.min.js', array( 'backbone' ), '2.0.0', true );
		wp_register_script(
			'marionette', PODS_URL . 'ui/js/marionette/backbone.marionette.min.js', array(
				'backbone',
				'backbone.radio',
			), '3.3.1', true
		);

		// MV stuff
		wp_register_script(
			'pods-dfv', PODS_URL . 'ui/js/pods-dfv/pods-dfv.min.js', array(
				'jquery',
				'jquery-ui-core',
				'jquery-ui-sortable',
				'pods-i18n',
				'marionette',
				'media-views',
				'media-models',
			), PODS_VERSION, true
		);

		// Check if Pod is a Modal Window
		if ( pods_is_modal_window() ) {
			add_filter( 'body_class', array( $this, 'add_classes_to_body_class' ) );
			add_filter( 'admin_body_class', array( $this, 'add_classes_to_body_class' ) );
		}

		// Deal with specifics on admin pages
		if ( is_admin() && function_exists( 'get_current_screen' ) ) {
			$screen = get_current_screen();

			// DFV must be enqueued on the media library page for items in grid mode (#4785)
			// and for posts due to the possibility that post-thumbnails are enabled (#4945)
			if ( $screen->base && in_array( $screen->base, array( 'upload', 'post' ), true ) ) {
				wp_enqueue_script( 'pods-dfv' );
			}
		}

		$this->maybe_register_handlebars();

		// As of 2.7 we combine styles to just three .css files
		wp_register_style( 'pods-styles', PODS_URL . 'ui/styles/dist/pods.css', array(), PODS_VERSION );
		wp_register_style( 'pods-wizard', PODS_URL . 'ui/styles/dist/pods-wizard.css', array(), PODS_VERSION );
		wp_register_style( 'pods-form', PODS_URL . 'ui/styles/dist/pods-form.css', array(), PODS_VERSION );

		/**
		 * Filter to enabled loading of the DFV script on frontend.
		 * By default, Pods does not load DFV on frontend.
		 *
		 * Example: add_filter( 'pods_enqueue_dfv_on_front', '__return_true' );
		 *
		 * @param bool Whether or not to enqueue by default
		 *
		 * @since 2.7.13
		 */
		if ( apply_filters( 'pods_enqueue_dfv_on_front', false ) ) {
			wp_enqueue_script( 'pods-dfv' );
			wp_enqueue_style( 'pods-form' );
		}
	}
1352513
public function setAttributes(array $attributes)
    {
        $this->attributes = [];
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
1259588
public function addAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
611821
public function add(array $attributes)
    {
        foreach ($attributes as $key => $values) {
            $this->set($key, $values);
        }

        return $this;
    }
987318
public function toManage($models, array $attributes = [])
    {
        if (is_array($models)) {
            foreach ($models as $model) {
                $this->to('*', $model, $attributes);
            }
        } else {
            $this->to('*', $models, $attributes);
        }
    }
518851
public function register_shortcode_ui() {
		$template = $this->get_page_template();
		$context  = [ 'page_template' => $template ];

		array_walk( $this->shortcode_uis,
			function ( ShortcodeUIInterface $shortcode_ui ) use ( $context ) {
				$shortcode_ui->register( $context );
			}
		);
	}