/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/app/View/Composers/Post.php
*/
public function pagination()
{
return wp_link_pages([
'echo' => 0,
'before' => '<p>'.__('Pages:', 'sage'),
'after' => '</p>',
]);
}
/**
* Get Pinned Blog Post
*/
public function pinnedPost()
{
$post = \carbon_get_theme_option('pin_p');
$output = [];
$output = [
'image' => wp_get_attachment_image_url(get_post_thumbnail_id($post[0]['id']), 'large'),
'cat' => get_the_category($post[0]['id'])[0]->name,
'cat_link' => get_the_category($post[0]['id'])[0]->slug,
'date' => get_the_date('F j, Y', $post[0]['id']),
'title' => get_the_title($post[0]['id']),
'link' => get_post_permalink($post[0]['id']),
'excerpt' => apply_filters('the_content', get_the_excerpt($post[0]['id'])),
'reading_time' => ceil(str_word_count(strip_tags(get_post_field('post_content', $post[0]['id']))) / 200)
];
return json_decode(json_encode($output));
}
/**
* Get Blog Collection fields
*/
public function blogs()
{
$output = [];
$output = [
Arguments
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/app/View/Composers/Post.php
*/
public function pagination()
{
return wp_link_pages([
'echo' => 0,
'before' => '<p>'.__('Pages:', 'sage'),
'after' => '</p>',
]);
}
/**
* Get Pinned Blog Post
*/
public function pinnedPost()
{
$post = \carbon_get_theme_option('pin_p');
$output = [];
$output = [
'image' => wp_get_attachment_image_url(get_post_thumbnail_id($post[0]['id']), 'large'),
'cat' => get_the_category($post[0]['id'])[0]->name,
'cat_link' => get_the_category($post[0]['id'])[0]->slug,
'date' => get_the_date('F j, Y', $post[0]['id']),
'title' => get_the_title($post[0]['id']),
'link' => get_post_permalink($post[0]['id']),
'excerpt' => apply_filters('the_content', get_the_excerpt($post[0]['id'])),
'reading_time' => ceil(str_word_count(strip_tags(get_post_field('post_content', $post[0]['id']))) / 200)
];
return json_decode(json_encode($output));
}
/**
* Get Blog Collection fields
*/
public function blogs()
{
$output = [];
$output = [
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/app/View/Composers/Post.php
protected static $views = [
'partials.page-header',
'partials.content',
'partials.content-*',
'index',
'template-news-and-press',
'search',
];
/**
* Data to be passed to view before rendering, but after merging.
*
* @return array
*/
public function override()
{
return [
'title' => $this->title(),
'pagination' => $this->pagination(),
'pinnedPost' => $this->pinnedPost(),
'blogs' => $this->blogs(),
'singleBlog' => $this->singleBlog(),
'recent' => $this->recent(),
'newsPress' => function($cat_id) {
$output = [];
$posts = get_posts([
'post_type' => 'post',
'numberposts' => 6,
'category' => $cat_id,
]);
foreach($posts as $post) {
$output[] = (object)[
'image' => wp_get_attachment_image_url(get_post_thumbnail_id($post), 'large'),
'title' => get_the_title($post),
'link' => get_post_permalink($post),
'date' => get_the_date('F j, Y', $post),
'reading_time' => ceil(str_word_count(strip_tags(get_post_field('post_content', $post))) / 200)
];
}
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php
* Compose the view before rendering.
*
* @return void
*/
public function compose(View $view)
{
$this->view = $view;
$this->data = new Fluent($view->getData());
$view->with($this->merge());
}
/**
* The merged data to be passed to view before rendering.
*
* @return array
*/
protected function merge()
{
[$with, $override] = [$this->with(), $this->override()];
if (! $with && ! $override) {
return array_merge(
$this->extractPublicProperties(),
$this->extractPublicMethods(),
$this->view->getData()
);
}
return array_merge(
$with,
$this->view->getData(),
$override
);
}
/**
* The data passed to the view before rendering.
*
* @return array
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php
return static::$views;
}
$view = array_slice(explode('\\', static::class), 3);
$view = array_map([Str::class, 'snake'], $view, array_fill(0, count($view), '-'));
return implode('/', $view);
}
/**
* Compose the view before rendering.
*
* @return void
*/
public function compose(View $view)
{
$this->view = $view;
$this->data = new Fluent($view->getData());
$view->with($this->merge());
}
/**
* The merged data to be passed to view before rendering.
*
* @return array
*/
protected function merge()
{
[$with, $override] = [$this->with(), $this->override()];
if (! $with && ! $override) {
return array_merge(
$this->extractPublicProperties(),
$this->extractPublicMethods(),
$this->view->getData()
);
}
return array_merge(
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/illuminate/view/Concerns/ManagesEvents.php
return $callback;
}
/**
* Build a class based container callback Closure.
*
* @param string $class
* @param string $prefix
* @return \Closure
*/
protected function buildClassEventCallback($class, $prefix)
{
[$class, $method] = $this->parseClassEvent($class, $prefix);
// Once we have the class and method name, we can build the Closure to resolve
// the instance out of the IoC container and call the method on it with the
// given arguments that are passed to the Closure as the composer's data.
return function () use ($class, $method) {
return $this->container->make($class)->{$method}(...func_get_args());
};
}
/**
* Parse a class based composer name.
*
* @param string $class
* @param string $prefix
* @return array
*/
protected function parseClassEvent($class, $prefix)
{
return Str::parseCallback($class, $this->classEventMethodForPrefix($prefix));
}
/**
* Determine the class event method based on the given prefix.
*
* @param string $prefix
* @return string
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/illuminate/events/Dispatcher.php
* @param \Closure|string|array $listener
* @param bool $wildcard
* @return \Closure
*/
public function makeListener($listener, $wildcard = false)
{
if (is_string($listener)) {
return $this->createClassListener($listener, $wildcard);
}
if (is_array($listener) && isset($listener[0]) && is_string($listener[0])) {
return $this->createClassListener($listener, $wildcard);
}
return function ($event, $payload) use ($listener, $wildcard) {
if ($wildcard) {
return $listener($event, $payload);
}
return $listener(...array_values($payload));
};
}
/**
* Create a class based listener using the IoC container.
*
* @param string $listener
* @param bool $wildcard
* @return \Closure
*/
public function createClassListener($listener, $wildcard = false)
{
return function ($event, $payload) use ($listener, $wildcard) {
if ($wildcard) {
return call_user_func($this->createClassCallable($listener), $event, $payload);
}
$callable = $this->createClassCallable($listener);
return $callable(...array_values($payload));
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/illuminate/events/Dispatcher.php
}
/**
* Broadcast an event and call its listeners.
*
* @param string|object $event
* @param mixed $payload
* @param bool $halt
* @return array|null
*/
protected function invokeListeners($event, $payload, $halt = false)
{
if ($this->shouldBroadcast($payload)) {
$this->broadcastEvent($payload[0]);
}
$responses = [];
foreach ($this->getListeners($event) as $listener) {
$response = $listener($event, $payload);
// If a response is returned from the listener and event halting is enabled
// we will just return this response, and not call the rest of the event
// listeners. Otherwise we will add the response on the response list.
if ($halt && ! is_null($response)) {
return $response;
}
// If a boolean false is returned from a listener, we will stop propagating
// the event to any further listeners down in the chain, else we keep on
// looping through the listeners and firing every one in our sequence.
if ($response === false) {
break;
}
$responses[] = $response;
}
return $halt ? null : $responses;
}
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/illuminate/events/Dispatcher.php
// payload to the handler, which makes object based events quite simple.
[$isEventObject, $event, $payload] = [
is_object($event),
...$this->parseEventAndPayload($event, $payload),
];
// If the event is not intended to be dispatched unless the current database
// transaction is successful, we'll register a callback which will handle
// dispatching this event on the next successful DB transaction commit.
if ($isEventObject &&
$payload[0] instanceof ShouldDispatchAfterCommit &&
! is_null($transactions = $this->resolveTransactionManager())) {
$transactions->addCallback(
fn () => $this->invokeListeners($event, $payload, $halt)
);
return null;
}
return $this->invokeListeners($event, $payload, $halt);
}
/**
* Broadcast an event and call its listeners.
*
* @param string|object $event
* @param mixed $payload
* @param bool $halt
* @return array|null
*/
protected function invokeListeners($event, $payload, $halt = false)
{
if ($this->shouldBroadcast($payload)) {
$this->broadcastEvent($payload[0]);
}
$responses = [];
foreach ($this->getListeners($event) as $listener) {
$response = $listener($event, $payload);
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/illuminate/view/Concerns/ManagesEvents.php
protected function addEventListener($name, $callback)
{
if (str_contains($name, '*')) {
$callback = function ($name, array $data) use ($callback) {
return $callback($data[0]);
};
}
$this->events->listen($name, $callback);
}
/**
* Call the composer for a given view.
*
* @param \Illuminate\Contracts\View\View $view
* @return void
*/
public function callComposer(ViewContract $view)
{
$this->events->dispatch('composing: '.$view->name(), [$view]);
}
/**
* Call the creator for a given view.
*
* @param \Illuminate\Contracts\View\View $view
* @return void
*/
public function callCreator(ViewContract $view)
{
$this->events->dispatch('creating: '.$view->name(), [$view]);
}
}
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/illuminate/view/View.php
} catch (Throwable $e) {
$this->factory->flushState();
throw $e;
}
}
/**
* Get the contents of the view instance.
*
* @return string
*/
protected function renderContents()
{
// We will keep track of the number of views being rendered so we can flush
// the section after the complete rendering operation is done. This will
// clear out the sections for any separate views that may be rendered.
$this->factory->incrementRender();
$this->factory->callComposer($this);
$contents = $this->getContents();
// Once we've finished rendering the view, we'll decrement the render count
// so that each section gets flushed out next time a view is created and
// no old sections are staying around in the memory of an environment.
$this->factory->decrementRender();
return $contents;
}
/**
* Get the evaluated contents of the view.
*
* @return string
*/
protected function getContents()
{
return $this->engine->get($this->path, $this->gatherData());
}
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/vendor/illuminate/view/View.php
*
* @return string
*/
protected function allFragments()
{
return collect($this->render(fn () => $this->factory->getFragments()))->implode('');
}
/**
* Get the string contents of the view.
*
* @param callable|null $callback
* @return string
*
* @throws \Throwable
*/
public function render(?callable $callback = null)
{
try {
$contents = $this->renderContents();
$response = isset($callback) ? $callback($this, $contents) : null;
// Once we have the contents of the view, we will flush the sections if we are
// done rendering all views so that there is nothing left hanging over when
// another view gets rendered in the future by the application developer.
$this->factory->flushStateIfDoneRendering();
return ! is_null($response) ? $response : $contents;
} catch (Throwable $e) {
$this->factory->flushState();
throw $e;
}
}
/**
* Get the contents of the view instance.
*
* @return string
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/index.php
<?php
echo view(app('sage.view'), app('sage.data'))->render();
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-includes/template-loader.php
}
break;
}
}
if ( ! $template ) {
$template = get_index_template();
}
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
Arguments
"/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-content/themes/pegasus/index.php"
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-blog-header.php
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
Arguments
"/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-includes/template-loader.php"
/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/index.php
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
Arguments
"/var/www/vhosts/pegasus.kalerwhales.com/httpdocs/wp-blog-header.php"