Populate page for posts item where necessary.

@access public
12077
public function populate_page_for_posts_items() {
		$page_for_posts = get_option( 'page_for_posts' );
		if ( ! $page_for_posts ) {
			return;
		}

		if ( $this->is_post_context() ) {
			$locator = Carbon_Breadcrumb_Locator::factory( 'post', 'page' );
			$items   = $locator->get_items( 500, $page_for_posts );
			$this->get_trail()->add_item( $items );
		}
	}
253188
protected function submitAddPage()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('page');
        $this->addPage();
    }
514170
protected function loadItemsForCurrentPage()
    {
        $items = $this->adapter->getItems($this->getOffset(), $this->itemsCountPerPage, $this->sort);
        if (!($items instanceof \Traversable)) {
            $this->items = new \ArrayIterator($items);
        } else {
            $this->items = $items;
        }
    }
218750
public function init()
    {
        $pages = $this->getModel()->getPages();

        // Check datas
        if (empty($pages)) {
            return;
        }

        global $admin_page_hooks;

        // Set the internal pointer of an array to its first element
        reset($pages);

        // Update identifier
        $identifier = Helpers::urlize(key($pages));
        $this->getModel()->setIdentifier($identifier);

        // Add root single menu if identifier is unknown
        if (!isset($admin_page_hooks[$identifier])) {
            $this->addRootPage();
        }

        // Iterate on pages
        foreach ($pages as $slug => $options) {
            if (empty($options)) {
                continue;
            }

            // Get slug
            $slug = Helpers::urlize($slug);

            // Add child menu
            $this->addChild($slug, $options);
        }
    }
46113
public function fill()
    {
        $languages = $this->languageRepository->activeLanguages();
        $this->initPages($languages);
        $this->initBasePages($languages);
    }
103052
public function populate()
    {
        foreach ($this->languages as $language => $key) {
            $contents = $this->contentRepository->findByContentTypeAndCondition($language);

            $this->multipleIndexor->indexMultiple($contents);
        }
    }
1355147
public function post()
    {
        $this->setPostedAt(new \DateTime());

        $this->ensureZeroSumOfPostings();

        foreach ($this->getPostings() as $posting) {
            $posting->post();
        }
    }
397875
public function populate($data = array())
    {
        $this->pageId = (isset($data['pageId'])) ? $data['pageId'] : null;
        $this->pageName = (isset($data['pageName'])) ? $data['pageName'] : null;
        $this->pageLink = (isset($data['pageLink'])) ? $data['pageLink'] : null;

    }
632927
private function populate_input()
    {
        if ($this->get_method() === 'GET') {
            $this->input = new Bag($this->query->to_array());
        } else {
            $this->input = new Bag(
                \array_merge($this->query->to_array(), $this->post->to_array(), $this->files->to_array())
            );
        }
    }
1024306
protected function postsArgs() {
		global $wp_query, $wp_rewrite;

		// Setting up default values based on the current URL.
		$pagenum_link    = html_entity_decode( get_pagenum_link() );
		$this->url_parts = explode( '?', $pagenum_link );

		// Get total number of pages.
		$total = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1;

		// Get the current page.
		$current = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;

		// Append the format placeholder to the base URL.
		$base = trailingslashit( $this->url_parts[0] ) . '%_%';

		// URL base depends on permalink settings.
		$format  = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
		$format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%';

		return [
			'base'    => $base,
			'format'  => $format,
			'total'   => $total,
			'current' => $current
		];
	}
413818
private function setup_pages() {

		$args                 = array(
			'capability' => 'manage_options',
			'icon'       => null,
			'position'   => null,
		);
		$this->struct['args'] = array_merge( $args, $this->struct );

		if ( ! isset( $this->struct['parent'] ) ) {
			add_action( 'admin_menu', array( $this, 'add_settings_page' ), 9 );
		} else {
			add_action( 'admin_menu', array( $this, 'add_sub_page' ), 9 );
		}

	}
783859
public function postPersist()
    {
        if ($this->lifecycleEventsActive) {
            $collection = $this->resourceManager->getCollection($this->collectionName);
            $collection->getTarget()->publishResource($this, $collection);
        }
    }
567473
public function index()
    {
        $query = $this->Pages->find()->contain(['Categories' => ['fields' => ['id', 'title']]]);

        $this->paginate['order'] = ['created' => 'DESC'];

        $pages = $this->paginate($this->Pages->queryFromFilter($query, $this->request->getQueryParams()));

        $this->set(compact('pages'));
    }
1136487
def prepare_page(self, *args, **kwargs):
        '''
        
        '''
        super(BaseBackend, self).prepare_page(*args, **kwargs)
1193176
final private function __setDataFromPost()
    {
        // Only set data from $post to App class
        if ($this->template !== 'app') {
            return;
        }

        // Only continue if $post is available
        if (!is_singular()) {
            return;
        }

        // Set $this->post to allow users to use $this->post->post_title and others
        $this->post = get_post();

        // Set the post array to be included in $this->data
        $this->data['post'] = $this->post;
    }
537358
public function init() {

		$posts = array();

		if ( ! $posts = wp_cache_get( 'sidebars', 'custom_sidebars' ) ) {
			$args = array(
				'post_type' => Custom_Sidebars::get_post_types(),
				'meta_query' => array(
					array(
						'key'   => '_custom_sidebar',
						'value' => true,
					)
				)
			);

			$query = new WP_Query( $args );

			if ( $query->have_posts() ) {
				$posts = $query->posts;
			}

			wp_cache_set( 'sidebars', 'custom_sidebars' );
		}

		foreach ( $posts as $post ) {
			$args = apply_filters( 'custom_sidebar_args', array(
				'name'          => sprintf( __( 'Sidebar: %s', 'custom_sidebars' ), $post->post_title ),
				'id'            => $this->get_sidebar_id( $post->ID ),
				'description'   => sprintf( __( 'This sidebar will appear on the %s single page.', 'cd-sidebar' ), $post->post_title ),
				'class'         => '',
				'before_widget' => '<aside id="%1$s" class="widget %2$s">',
				'after_widget'  => '</aside>',
				'before_title'  => '<h2 class="widget-title">',
				'after_title'   => '</h2>',
			) );

			register_sidebar( $args );
		}

	}
1286149
public function index()
    {
        $query = $this->PostsTags->Tags->find()->matching('Posts');

        $this->paginate['order'] = ['tag' => 'ASC'];

        //Limit X4
        $this->paginate['limit'] = $this->paginate['maxLimit'] = $this->paginate['limit'] * 4;

        $tags = $this->paginate($this->PostsTags->Tags->queryFromFilter($query, $this->request->getQueryParams()));

        $this->set(compact('tags'));
    }