Displays a Bootstrap form buttons "default".

@param array $args The arguments.
@return string Returns the Bootstrap form button "Default".
976502
public function bootstrapFormButtonDefaultFunction(array $args = []) {

        $cancelButton = $this->bootstrapFormButtonCancelFunction(["href" => ArrayHelper::get($args, "cancel_href")]);
        $submitButton = $this->bootstrapFormButtonSubmitFunction();

        // Return the HTML.
        return implode(" ", [$cancelButton, $submitButton]);
    }
486730
public function siteNameHeading(array $args = [])
    {
        $defaults = [
            'id'     => 'site-name',
            'class'  => 'site-name',
            'homeEl' => 'h1',
            'pageEl' => 'h3'
        ];

        $args = wp_parse_args($args, $defaults);
        extract($args, EXTR_SKIP);

        $el = (is_front_page() || is_home()) ? $homeEl : $pageEl;

        $output = [];
        $output[] = sprintf('<%s id="%s" class="%s">', $el, $id, $class);
        $output[] = get_bloginfo('name');
        $output[] = sprintf('</%s>', $el);

        return apply_filters('novusopress_view_site_name_heading_output', implode('', $output));
    }
1268790
public function show($args = [])
    {
        $js_chain = $this->js();
        if (!empty($args)) {
            $js_chain->data(['args' => $args]);
        }

        return $js_chain->modal('show');
    }
191231
private function _parseArgs(array $args)
	{
		$arg = '';
		if(count($args) > 0)
		{
			foreach($args as $number => $argument)
			{
				if($number === 0)
				{
					$arg .= $argument;
				}
				else
				{
					$arg .= ', ' . $argument;
				}
			}
		}

		return $arg;
	}
428225
protected function parseValue( array $args )
	{
		$default = $args['default'];
		$name    = $args['name'];
		$prefix  = $args['prefix'];
		$value   = $args['value'];

		if( $default == ':placeholder' ) {
			$default = '';
		}

		return ( !empty( $value ) || !$name || $prefix === false )
			? $value
			: $default;
	}
359290
public function bootstrapAlertLinkFunction(array $args = []) {

        $attributes = [];

        $attributes["href"] = ArrayHelper::get($args, "href", NavigationInterface::NAVIGATION_HREF_DEFAULT);

        $innerHTML = ArrayHelper::get($args, "content");

        return static::coreHTMLElement("a", $innerHTML, $attributes);
    }
1249988
public function pageDropDown(array $args)
    {
        $default = $args['post_type']->name;
        if (isset($this->original_slugs[$args['post_type']->name])) {
            $default = self::$originalSlugs[$args['post_type']->name];
        }

        wp_dropdown_pages(array(
            'post_status'      => array('publish', 'private'),
            'name'             => esc_attr($args['name']),
            'id'               => esc_attr($args['name'] . '_dropdown'),
            'selected'         => esc_attr($args['value']),
            'show_option_none' => sprintf(__('Default (/%s/)'), $default),
        ));

        $useTemplate = checked(get_option('page_for_' . $args['post_type']->name . '_template'), 'on', false);
        if ($useTemplate) {
            echo '<label style="margin-left: 10px;"><input type="checkbox" name="page_for_' . $args['post_type']->name . '_template" checked> ' . __('Use template from page', 'wp-page-for-post-type') . '</label>';
        } else {
            echo '<label style="margin-left: 10px;"><input type="checkbox" name="page_for_' . $args['post_type']->name . '_template"> ' . __('Use template from page', 'wp-page-for-post-type') . '</label>';
        }

        $useContent = checked(get_option('page_for_' . $args['post_type']->name . '_content'), 'on', false);
        if ($useContent) {
            echo '<label style="margin-left: 10px;"><input type="checkbox" name="page_for_' . $args['post_type']->name . '_content" checked> ' . __('Use content from page', 'wp-page-for-post-type') . '</label>';
        } else {
            echo '<label style="margin-left: 10px;"><input type="checkbox" name="page_for_' . $args['post_type']->name . '_content"> ' . __('Use content from page', 'wp-page-for-post-type') . '</label>';
        }
    }
90777
public function devMode($args){

        if(empty($args[0])){
            $mode = \Disco\manage\Manager::devMode();
            echo 'DEV_MODE : ' . (($mode) ? 'true' : 'false') . PHP_EOL;
            exit;
        }//if
        else if($args[0] != 'true' && $args[0] != 'false'){
            echo 'Mode takes one of two values: true | false' . PHP_EOL . 'Please supply a correct value' . PHP_EOL;
            exit;
        }//if

        \Disco\manage\Manager::devMode(($args[0] == 'true') ? true : false);
        echo 'DEV_MODE now set to: ' . $args[0] . PHP_EOL;

    }
416196
public function normalize( array $args = [] )
	{
		$defaults = [
			'after'       => '',
			'attributes'  => '',
			'before'      => '',
			'class'       => '',
			'default'     => null,
			'depends'     => null,
			'desc'        => '',
			'errors'      => [],
			'inline'      => false,
			'label'       => '',
			'name'        => '',
			'options'     => [],
			'path'        => '',
			'placeholder' => '',
			'prefix'      => '',
			'render'      => true,
			'suffix'      => null,
			'type'        => 'text',
			'value'       => '',
		];

		$args = $atts = wp_parse_args( $args, $defaults );

		$args['attributes'] = $this->parseAttributes( $atts );
		$args['id']         = $this->parseId( $atts );
		$args['inline']     = $this->parseInline( $atts );
		$args['type']       = $this->parseType( $atts );
		$args['name']       = $this->parseName( $atts );
		$args['options']    = (array) $atts['options']; // make sure this is always an array
		$args['path']       = $atts['name'];
		$args['prefix']     = $this->parsePrefix( $atts );
		$args['value']      = $this->parseValue( $atts );

		$this->args = $args;
		$this->dependencies = $this->getField( $args )->dependencies;

		$this->setDataDepends();
		$this->checkForErrors( $atts );

		return $this;
	}
518171
public function selectOptions(array $args = []): string
    {
        // Establish args.

        $default_args = [
            // Unique.
            'allow_empty'              => true,
            'allow_arbitrary'          => true,
            'option_child_indent_char' => '-',
            'option_formatter'         => null,
            'current_post_ids'         => null,

            // Used by {@link all()}.
            'max'         => 1000,
            'fail_on_max' => true,

            // Used by {@link total()}.
            // Used by {@link all()}.
            'for_comments_only' => false,

            'include_post_ids' => [],
            'exclude_post_ids' => [],

            'include_post_types' => !$this->Wp->is_admin
                ? get_post_types(['public' => true, 'exclude_from_search' => false])
                : get_post_types(['exclude_from_search' => false]),
            'exclude_post_types' => [],

            'include_post_statuses' => !$this->Wp->is_admin
                ? get_post_stati(['public' => true, 'exclude_from_search' => false])
                : get_post_stati(['exclude_from_search' => false]),
            'exclude_post_statuses' => [],

            'exclude_drafts'             => true,
            'exclude_revisions'          => true,
            'exclude_trash'              => true,
            'exclude_password_protected' => !$this->Wp->is_admin,
            'exclude_nav_menu_items'     => true,

            'no_cache' => false,
        ];
        $args = array_merge($default_args, $args);
        $args = array_intersect_key($args, $default_args);

        // Unique.
        $args['allow_empty']              = (bool) $args['allow_empty'];
        $args['allow_arbitrary']          = (bool) $args['allow_arbitrary'];
        $args['option_child_indent_char'] = (string) $args['option_child_indent_char'];
        $args['option_formatter']         = is_callable($args['option_formatter']) ? $args['option_formatter'] : null;
        $args['current_post_ids']         = isset($args['current_post_ids']) ? (array) $args['current_post_ids'] : null;
        $args['current_post_ids']         = $this->c::removeEmptys(array_map('intval', $args['current_post_ids']));

        // Used by {@link all()}.
        $args['max']         = max(1, (int) $args['max']);
        $args['fail_on_max'] = (bool) $args['fail_on_max'];

        // Used by {@link total()}.
        // Used by {@link all()}.
        $args['for_comments_only'] = (bool) $args['for_comments_only'];

        $args['include_post_ids'] = (array) $args['include_post_ids'];
        $args['exclude_post_ids'] = (array) $args['exclude_post_ids'];

        $args['include_post_types'] = (array) $args['include_post_types'];
        $args['exclude_post_types'] = (array) $args['exclude_post_types'];

        $args['include_post_statuses'] = (array) $args['include_post_statuses'];
        $args['exclude_post_statuses'] = (array) $args['exclude_post_statuses'];

        $args['exclude_drafts']             = (bool) $args['exclude_drafts'];
        $args['exclude_revisions']          = (bool) $args['exclude_revisions'];
        $args['exclude_trash']              = (bool) $args['exclude_trash'];
        $args['exclude_password_protected'] = (bool) $args['exclude_password_protected'];
        $args['exclude_nav_menu_items']     = (bool) $args['exclude_nav_menu_items'];

        $args['no_cache'] = (bool) $args['no_cache'];

        // Check for nothing being available (or too many).

        if (!($posts = $this->all($args))) {
            return ''; // None available.
        }
        // Initialize several working variables needed below.

        $options                 = ''; // Initialize.
        $available_post_ids      = []; // Initialize.
        $selected_post_ids       = []; // Initialize.
        $default_post_type_label = __('Post', 'wp-sharks-core');
        $default_post_title      = __('Untitled', 'wp-sharks-core');

        // Build & return all `<option>` tags.

        if ($args['allow_empty']) { // Allow `0`?
            $options = '<option value="0"></option>';
        }
        $walk = function (// Recursive parent/child walker.
            int $parent_post_id = 0,
            int $parent_depth = 0
        ) use (
            &$walk,
            &$args,
            &$posts,
            &$options,
            &$available_post_ids,
            &$selected_post_ids,
            &$default_post_type_label,
            &$default_post_title
        ) {
            foreach ($posts as $_post) { // \WP_Post objects.
                if ((int) $_post->post_parent !== $parent_post_id) {
                    continue; // Bypass this child for now.
                }
                $available_post_ids[] = (int) $_post->ID; // Record all available.

                if (isset($args['current_post_ids']) && in_array((int) $_post->ID, $args['current_post_ids'], true)) {
                    $selected_post_ids[$_post->ID] = (int) $_post->ID; // Flag selected post ID.
                }
                $_post_type_object = get_post_type_object($_post->post_type); // Anticipate a possible failure.
                $_post_type_label  = !empty($_post_type_object->labels->singular_name) ? $_post_type_object->labels->singular_name : $default_post_type_label;

                $_post_title            = $_post->post_title ?: $default_post_title;
                $_post_date             = $this->s::dateI18nUtc('M jS, Y', strtotime($_post->post_date_gmt));
                $_post_id_selected_attr = isset($selected_post_ids[$_post->ID]) ? ' selected' : '';

                // Format `<option>` tag w/ a custom formatter?

                if ($args['option_formatter']) {
                    $options .= $args['option_formatter']($_post, [
                            'parent_post_id'        => $parent_post_id,
                            'parent_depth'          => $parent_depth,
                            'post_type_object'      => $_post_type_object,
                            'post_type_label'       => $_post_type_label,
                            'post_title'            => $_post_title,
                            'post_date'             => $_post_date,
                            'post_id_selected_attr' => $_post_id_selected_attr,
                        ], $args); // ↑ This allows for a custom option formatter.
                        // The formatter must always return an `<option></option>` tag.

                // Else format the `<option>` tag using a default behavior.
                } elseif ($this->Wp->is_admin) { // Slightly different format in admin area.
                    $options .= '<option value="'.esc_attr($_post->ID).'"'.$_post_id_selected_attr.'>'.
                                    ($parent_depth > 0 ? str_repeat('&nbsp;', $parent_depth).$args['option_child_indent_char'].' ' : '').
                                    esc_html($_post_type_label.' #'.$_post->ID.': '.$_post_title).
                                '</option>';
                } else { // Front-end display should be friendlier in some ways.
                    $options .= '<option value="'.esc_attr($_post->ID).'"'.$_post_id_selected_attr.'>'.
                                    ($parent_depth > 0 ? str_repeat('&nbsp;', $parent_depth).$args['option_child_indent_char'].' ' : '').
                                    esc_html($_post_date.' — '.$_post_title).
                                '</option>';
                }
                $walk((int) $_post->ID, $parent_depth + 1); // Any children this term has.
                //
            } // unset($_post, $_post_type_object, $_post_type_label, $_post_title, $_post_date, $_post_id_selected_attr); // Housekeeping.
        };
        $walk(0, 0); // Start walking/building the parent » child `<option>` tags.

        if ($args['allow_arbitrary'] && $args['current_post_ids']) { // Allow arbitrary select `<option>`s?
            foreach (array_diff($args['current_post_ids'], $available_post_ids) as $_arbitrary_post_id) {
                $options .= '<option value="'.esc_attr($_arbitrary_post_id).'" selected>'.
                                esc_html($default_post_type_label.' #'.$_arbitrary_post_id).
                            '</option>';
            } // unset($_arbitrary_post_id); // Housekeeping.
        }
        return $options; // HTML markup.
    }
903005
public function bootstrapGridPushFunction(array $args = []) {
        return $this->bootstrapGrid(ArrayHelper::get($args, "lgPush"), ArrayHelper::get($args, "mdPush"), ArrayHelper::get($args, "smPush"), ArrayHelper::get($args, "xsPush"), ArrayHelper::get($args, "recopyPush", false), "push");
    }
572634
public function bootstrapGridOffsetFunction(array $args = []) {
        return $this->bootstrapGrid(ArrayHelper::get($args, "lgOffset"), ArrayHelper::get($args, "mdOffset"), ArrayHelper::get($args, "smOffset"), ArrayHelper::get($args, "xsOffset"), ArrayHelper::get($args, "recopyOffset", false), "offset");
    }
451375
public function bootstrapAlertDangerFunction(array $args = []) {
        return $this->bootstrapAlert(ArrayHelper::get($args, "content"), ArrayHelper::get($args, "dismissible"), "alert-" . BootstrapInterface::BOOTSTRAP_DANGER);
    }
1266570
public function bootstrapHeading6Function(array $args = []) {
        return $this->bootstrapHeading(6, ArrayHelper::get($args, "content"), ArrayHelper::get($args, "description"), ArrayHelper::get($args, "class"));
    }
1246839
public static function debug(array $args)
    {
        $str = "\r\n";
        $str .= self::startBlackText() .
            self::startYellowBackground() .
            self::getCallingFileName() . '::' . self::getCallingFileLine() .
            "\033[0m" . "\r\n";

        foreach ($args as $arg) {
            $str .=
                self::startBlackText() .
                self::startYellowBackground() .
                self::getParameter($arg) .
                "\033[0m" . "\r\n";
        }

        return $str . "\r\n";
    }
1215754
public function bootstrapGridPullFunction(array $args = []) {
        return $this->bootstrapGrid(ArrayHelper::get($args, "lgPull"), ArrayHelper::get($args, "mdPull"), ArrayHelper::get($args, "smPull"), ArrayHelper::get($args, "xsPull"), ArrayHelper::get($args, "recopyPull", false), "pull");
    }
1350768
public function wp_bootstrap_pagination($args = array())
    {

        $defaults = array(
            'range' => 4,
            'custom_query' => FALSE,
            'previous_string' => __('Previous', 'theme'),
            'next_string' => __('Next', 'theme'),
            'before_output' => '<div class="post-nav"><ul class="pager">',
            'after_output' => '</ul></div>'
        );

        $args = wp_parse_args($args, apply_filters('wp_bootstrap_pagination_defaults', $defaults));

        $args['range'] = (int)$args['range'] - 1;
        if (!$args['custom_query'])
            $args['custom_query'] = @$GLOBALS['wp_query'];
        $count = (int)$args['custom_query']->max_num_pages;
        $page = intval(get_query_var('paged'));
        $ceil = ceil($args['range'] / 2);

        if ($count <= 1)
            return FALSE;

        if (!$page)
            $page = 1;

        if ($count > $args['range']) {
            if ($page <= $args['range']) {
                $min = 1;
                $max = $args['range'] + 1;
            } elseif ($page >= ($count - $ceil)) {
                $min = $count - $args['range'];
                $max = $count;
            } elseif ($page >= $args['range'] && $page < ($count - $ceil)) {
                $min = $page - $ceil;
                $max = $page + $ceil;
            }
        } else {
            $min = 1;
            $max = $count;
        }

        $echo = '';
        $previous = intval($page) - 1;
        $previous = esc_attr(get_pagenum_link($previous));

        $firstpage = esc_attr(get_pagenum_link(1));
        if ($firstpage && (1 != $page))
            $echo .= '<li class="previous"><a href="' . $firstpage . '">' . __('First', 'theme') . '</a></li>';
        if ($previous && (1 != $page))
            $echo .= '<li><a href="' . $previous . '" title="' . __('previous', 'theme') . '">' . $args['previous_string'] . '</a></li>';

        if (!empty($min) && !empty($max)) {
            for ($i = $min; $i <= $max; $i++) {
                if ($page == $i) {
                    $echo .= '<li class="active"><span class="active">' . str_pad((int)$i, 2, '0', STR_PAD_LEFT) . '</span></li>';
                } else {
                    $echo .= sprintf('<li><a href="%s">%002d</a></li>', esc_attr(get_pagenum_link($i)), $i);
                }
            }
        }

        $next = intval($page) + 1;
        $next = esc_attr(get_pagenum_link($next));
        if ($next && ($count != $page))
            $echo .= '<li><a href="' . $next . '" title="' . __('next', 'theme') . '">' . $args['next_string'] . '</a></li>';

        $lastpage = esc_attr(get_pagenum_link($count));
        if ($lastpage) {
            $echo .= '<li class="next"><a href="' . $lastpage . '">' . __('Last', 'theme') . '</a></li>';
        }
        if (isset($echo))
            echo $args['before_output'] . $echo . $args['after_output'];
    }