/home/user_13613/app_13613_staging/wp-content/themes/nabsolutions/template-parts/modules/nab-news-hero.php
}
} else {
$categories = $acfCats;
}
//Om det är en kategorisida dvs "ett kategori-arkiv" så skriver vi över acf kategorier med den aktuella kategorin
//för att visa endast posts från den kategorin
global $is_category_page;
global $current_category;
if($is_category_page) {
$categories = array($current_category->slug);
}
$posts = nab_getNewsList(
$categories,
1
);
$args = $posts[0];
// else if (isset($_GET['category']) && !empty($_GET['category'])) {
// $heroIsSubpage = TRUE;
// $heroParentPage = get_page_by_path( 'nyheter' );
// $currentPageTitle = 'Kategori: ' . get_category_by_slug($_GET['category'])->name;
// }
if(NAB_CURRENT_COUNTRY == 'sweden') {
$read_more = 'Läs mer';
$linkPreface = '/se/nyheter/kategori/';
} elseif(NAB_CURRENT_COUNTRY == 'usa') {
$read_more = 'Read post';
$linkPreface = '/us/news/category/';
} elseif(NAB_CURRENT_COUNTRY == 'uk') {
$read_more = 'Read post';
$linkPreface = '/uk/news/category/';
} elseif(NAB_CURRENT_COUNTRY == 'denmark') {
$read_more = 'Læs indlæg';
$linkPreface = '/dk/news/category/';
} else {
/home/user_13613/app_13613_staging/wp-content/themes/nabsolutions/template-parts/modules/nab-news-hero.php
}
} else {
$categories = $acfCats;
}
//Om det är en kategorisida dvs "ett kategori-arkiv" så skriver vi över acf kategorier med den aktuella kategorin
//för att visa endast posts från den kategorin
global $is_category_page;
global $current_category;
if($is_category_page) {
$categories = array($current_category->slug);
}
$posts = nab_getNewsList(
$categories,
1
);
$args = $posts[0];
// else if (isset($_GET['category']) && !empty($_GET['category'])) {
// $heroIsSubpage = TRUE;
// $heroParentPage = get_page_by_path( 'nyheter' );
// $currentPageTitle = 'Kategori: ' . get_category_by_slug($_GET['category'])->name;
// }
if(NAB_CURRENT_COUNTRY == 'sweden') {
$read_more = 'Läs mer';
$linkPreface = '/se/nyheter/kategori/';
} elseif(NAB_CURRENT_COUNTRY == 'usa') {
$read_more = 'Read post';
$linkPreface = '/us/news/category/';
} elseif(NAB_CURRENT_COUNTRY == 'uk') {
$read_more = 'Read post';
$linkPreface = '/uk/news/category/';
} elseif(NAB_CURRENT_COUNTRY == 'denmark') {
$read_more = 'Læs indlæg';
$linkPreface = '/dk/news/category/';
} else {
/home/user_13613/app_13613_staging/wp-content/themes/nabsolutions/template-parts/modules-registrar.php
//--------------------------------------------------------------------------
// Static modules
//--------------------------------------------------------------------------
}
/**
*
*
* @param [Array] $block
* @return void
*/
function nab_acf_block_renderer( $block ) {
$slug = str_replace('acf/', '', $block['name']);
// print_r($slug);
if( file_exists( get_theme_file_path("/template-parts/modules/{$slug}.php") ) ) {
include( get_theme_file_path("/template-parts/modules/{$slug}.php") );
}
}
?>
/home/user_13613/app_13613_staging/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php
if ( ! $block ) {
return '';
}
// Find post_id if not defined.
if ( ! $post_id ) {
$post_id = get_the_ID();
}
// Enqueue block type assets.
acf_enqueue_block_type_assets( $block );
$block = acf_add_block_meta_values( $block, $post_id );
// Setup postdata allowing get_field() to work.
acf_setup_meta( $block['data'], $block['id'], true );
// Call render_callback.
if ( is_callable( $block['render_callback'] ) ) {
call_user_func( $block['render_callback'], $block, $content, $is_preview, $post_id, $wp_block, $context );
// Or include template.
} elseif ( $block['render_template'] ) {
do_action( 'acf_block_render_template', $block, $content, $is_preview, $post_id, $wp_block, $context );
}
// Reset postdata.
acf_reset_meta( $block['id'] );
}
/**
* Locate and include an ACF block's template.
*
* @since 6.0.4
*
* @param array $block The block props.
*/
function acf_block_render_template( $block, $content, $is_preview, $post_id, $wp_block, $context ) {
// Locate template.
if ( isset( $block['path'] ) && file_exists( $block['path'] . '/' . $block['render_template'] ) ) {
/home/user_13613/app_13613_staging/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php
$validation = acf_get_block_validation_state( $block, false, false, true );
}
$fields = acf_get_block_fields( $block );
if ( $fields ) {
acf_prefix_fields( $fields, "acf-{$block['id']}" );
echo '<div class="acf-block-fields acf-fields" data-block-id="' . esc_attr( $block['id'] ) . '">';
acf_render_fields( $fields, acf_ensure_block_id_prefix( $block['id'] ), 'div', 'field' );
echo '</div>';
} else {
echo acf_get_empty_block_form_html( $attributes['name'] ); //phpcs:ignore -- escaped in function.
}
} else {
if ( $is_preview ) {
acf_set_data( 'acf_doing_block_preview', true );
}
// Capture block render output.
acf_render_block( $attributes, $content, $is_preview, $post_id, $wp_block, $context );
if ( $is_preview && ! $is_ajax_render ) {
/**
* If we're in preloaded preview, we need to get the validation state for a preview too.
* Because the block render resets meta once it's finished to not pollute $post_id, we need to redo that process here.
*/
$block = acf_prepare_block( $attributes );
$block = acf_add_block_meta_values( $block, $post_id );
$block_toolbar_fields = acf_process_block_toolbar_fields( apply_filters( 'acf/blocks/top_toolbar_fields', array(), $block, $content, $is_preview, $post_id, $wp_block, $context ) );
$fields = acf_get_block_fields( $block );
acf_setup_meta( $block['data'], $block['id'], true );
if ( ! empty( $block['validate'] ) ) {
$validation = acf_get_block_validation_state( $block, false, false, true );
}
}
}
$html = ob_get_clean();
$html = is_string( $html ) ? $html : '';
/home/user_13613/app_13613_staging/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php
* @param WP_Block $wp_block The block instance (since WP 5.5).
* @return string The block HTML.
*/
function acf_render_block_callback( $attributes, $content = '', $wp_block = null ) {
$is_preview = false;
$post_id = get_the_ID();
// Set preview flag to true when rendering for the block editor.
if ( is_admin() && acf_is_block_editor() ) {
$is_preview = true;
}
// If ACF's block save method hasn't been called yet, try to initialize a default block.
if ( empty( $attributes['name'] ) && ! empty( $wp_block->name ) ) {
$attributes['name'] = $wp_block->name;
}
// Return rendered block HTML.
return acf_rendered_block( $attributes, $content, $is_preview, $post_id, $wp_block );
}
/**
* Returns the rendered block HTML.
*
* @date 28/2/19
* @since 5.7.13
*
* @param array $attributes The block attributes.
* @param string $content The block content.
* @param boolean $is_preview Whether or not the block is being rendered for editing preview.
* @param integer $post_id The current post being edited or viewed.
* @param WP_Block $wp_block The block instance (since WP 5.5).
* @param array $context The block context array.
* @param boolean $is_ajax_render Whether or not this is an ACF AJAX render.
* @return string The block HTML.
*/
function acf_rendered_block( $attributes, $content = '', $is_preview = false, $post_id = 0, $wp_block = null, $context = false, $is_ajax_render = false ) {
$registry = WP_Block_Type_Registry::get_instance();
$wp_block_type = $registry->get_registered( $attributes['name'] );
/home/user_13613/app_13613_staging/wp-includes/class-wp-block.php
}
++$index;
}
}
}
if ( ! empty( $computed_attributes ) && ! empty( $block_content ) ) {
foreach ( $computed_attributes as $attribute_name => $source_value ) {
$block_content = $this->replace_html( $block_content, $attribute_name, $source_value );
}
}
if ( $is_dynamic ) {
$global_post = $post;
$parent = WP_Block_Supports::$block_to_render;
WP_Block_Supports::$block_to_render = $this->parsed_block;
$block_content = (string) call_user_func( $this->block_type->render_callback, $this->attributes, $block_content, $this );
WP_Block_Supports::$block_to_render = $parent;
$post = $global_post;
}
if ( ( ! empty( $this->block_type->script_handles ) ) ) {
foreach ( $this->block_type->script_handles as $script_handle ) {
wp_enqueue_script( $script_handle );
}
}
if ( ! empty( $this->block_type->view_script_handles ) ) {
foreach ( $this->block_type->view_script_handles as $view_script_handle ) {
wp_enqueue_script( $view_script_handle );
}
}
if ( ! empty( $this->block_type->view_script_module_ids ) ) {
foreach ( $this->block_type->view_script_module_ids as $view_script_module_id ) {
/home/user_13613/app_13613_staging/wp-includes/blocks.php
*
* @param array $context Default context.
* @param array $parsed_block {
* An associative array of the block being rendered. See WP_Block_Parser_Block.
*
* @type string|null $blockName Name of block.
* @type array $attrs Attributes from block comment delimiters.
* @type array[] $innerBlocks List of inner blocks. An array of arrays that
* have the same structure as this one.
* @type string $innerHTML HTML from inside block comment delimiters.
* @type array $innerContent List of string fragments and null markers where
* inner blocks were found.
* }
* @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
*/
$context = apply_filters( 'render_block_context', $context, $parsed_block, $parent_block );
$block = new WP_Block( $parsed_block, $context );
return $block->render();
}
/**
* Parses blocks out of a content string.
*
* Given an HTML document, this function fully-parses block content, producing
* a tree of blocks and their contents, as well as top-level non-block content,
* which will appear as a block with no `blockName`.
*
* This function can be memory heavy for certain documents, particularly those
* with deeply-nested blocks or blocks with extensive attribute values. Further,
* this function must parse an entire document in one atomic operation.
*
* If the entire parsed document is not necessary, consider using {@see WP_Block_Processor}
* instead, as it provides a streaming and low-overhead interface for finding blocks.
*
* @since 5.0.0
*
* @param string $content Post content.
* @return array[] {
/home/user_13613/app_13613_staging/wp-includes/blocks.php
* Parsed blocks consist of a list of top-level blocks. Those top-level
* blocks may themselves contain nested inner blocks. However, every
* top-level block is rendered independently, meaning there are no data
* dependencies between them.
*
* Ideally, therefore, the parser would only need to parse one complete
* top-level block at a time, render it, and move on. Unfortunately, this
* is not possible with {@see \parse_blocks()} because it must parse the
* entire given document at once.
*
* While the current implementation prevents this optimization, it’s still
* possible to reduce the peak memory use when calls to `render_block()`
* on those top-level blocks are memory-heavy (which many of them are).
* By setting each parsed block to `NULL` after rendering it, any memory
* allocated during the render will be freed and reused for the next block.
* Before making this change, that memory was retained and would lead to
* out-of-memory crashes for certain posts that now run with this change.
*/
for ( $i = 0; $i < $top_level_block_count; $i++ ) {
$output .= render_block( $blocks[ $i ] );
$blocks[ $i ] = null;
}
// If there are blocks in this content, we shouldn't run wpautop() on it later.
$priority = has_filter( 'the_content', 'wpautop' );
if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) {
remove_filter( 'the_content', 'wpautop', $priority );
add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 );
}
return $output;
}
/**
* If do_blocks() needs to remove wpautop() from the `the_content` filter, this re-adds it afterwards,
* for subsequent `the_content` usage.
*
* @since 5.0.0
* @access private
*
/home/user_13613/app_13613_staging/wp-includes/class-wp-hook.php
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 === $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/home/user_13613/app_13613_staging/wp-includes/plugin.php
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
*
* @since 3.0.0
*
* @see apply_filters() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
/home/user_13613/app_13613_staging/wp-includes/post-template.php
/**
* Displays the post content.
*
* @since 0.71
*
* @param string $more_link_text Optional. Content for when there is more text.
* @param bool $strip_teaser Optional. Strip teaser content before the more text. Default false.
*/
function the_content( $more_link_text = null, $strip_teaser = false ) {
$content = get_the_content( $more_link_text, $strip_teaser );
/**
* Filters the post content.
*
* @since 0.71
*
* @param string $content Content of the current post.
*/
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
echo $content;
}
/**
* Retrieves the post content.
*
* @since 0.71
* @since 5.2.0 Added the `$post` parameter.
*
* @global int $page Page number of a single post/page.
* @global int $more Boolean indicator for whether single post/page is being viewed.
* @global bool $preview Whether post/page is in preview mode.
* @global array $pages Array of all pages in post/page. Each array element contains
* part of the content separated by the `<!--nextpage-->` tag.
* @global int $multipage Boolean indicator for whether multiple pages are in play.
*
* @param string $more_link_text Optional. Content for when there is more text.
* @param bool $strip_teaser Optional. Strip teaser content before the more text. Default false.
* @param WP_Post|object|int $post Optional. WP_Post instance or Post ID/object. Default null.
/home/user_13613/app_13613_staging/wp-content/themes/nabsolutions/template-parts/layout/application.php
</a>
<?php foreach ($childPages as $child_page): ?>
<a
href="<?= get_permalink($child_page->ID) ?>"
class="nab-reader-mobile-menu-dropdown-link <?= $currentPageId === $child_page->ID ? "is-active" : ""; ?>"
>
<?= $child_page->post_title ?>
</a>
<?php endforeach; ?>
</div>
</div>
<div class="nab-reader-content">
<?= the_content(); ?>
</div>
<!-- <div class="nab-reader-details"></div> -->
</div>
</section>
<?php else: ?>
<?= the_content(); ?>
<?php endif; ?>
<?php endwhile; ?>
<!-- <div class="nab-socials">
<div class="nab-socials-icons">
<a
href="https://se.linkedin.com/company/nab-solutions-ab"
class="nab-socials-icon"
target="_blank"
>
<img src="<?= NAB_IMAGE_PATH; ?>icons/linkedin-icon.png" alt="" class="nab-socials-icon-figure">
</a>
<a
href="https://www.facebook.com/nabsolutionsab/"
class="nab-socials-icon"
target="_blank"
>
<img src="<?= NAB_IMAGE_PATH; ?>icons/facebook-icon.svg" alt="" class="nab-socials-icon-figure">
</a>
<a
/home/user_13613/app_13613_staging/wp-content/themes/nabsolutions/page.php
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Well Hello
* @since 1.0
* @version 1.0
*/
require_once __DIR__ . '/template-parts/layout/application.php';
?>
/home/user_13613/app_13613_staging/wp-includes/template-loader.php
/**
* 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 ) {
/**
* Fires immediately before including the template.
*
* @since 6.9.0
*
* @param string $template The path of the template about to be included.
*/
do_action( 'wp_before_include_template', $template );
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
/home/user_13613/app_13613_staging/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';
}
/home/user_13613/app_13613_staging/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';