Astra_Get_Single_Post::execute( array $args )

Execute the ability.


Description


Parameters

$args

(array) (Required) Input arguments.


Return

(array) Result array.


Source

File: inc/abilities/customizer/posttypes/blog/class-astra-get-single-post.php

	public function execute( $args ) {
		$container_layout      = astra_get_option( 'single-post-ast-content-layout', 'default' );
		$container_style       = astra_get_option( 'site-content-style', 'unboxed' );
		$sidebar_layout        = astra_get_option( 'single-post-sidebar-layout', 'default' );
		$sidebar_style         = astra_get_option( 'single-post-sidebar-style', 'default' );
		$content_width         = astra_get_option( 'blog-single-width', 'default' );
		$content_max_width     = astra_get_option( 'blog-single-max-width', 1200 );
		$related_posts_enabled = astra_get_option( 'enable-related-posts', false );
		$related_posts_count   = astra_get_option( 'related-posts-total-count', 2 );

		$container_layout_labels = array(
			'default'                => 'Default',
			'normal-width-container' => 'Normal',
			'narrow-width-container' => 'Narrow',
			'full-width-container'   => 'Full Width',
		);

		$container_style_labels = array(
			'boxed'   => 'Boxed',
			'unboxed' => 'Unboxed',
		);

		$sidebar_layout_labels = array(
			'default'       => 'Default',
			'no-sidebar'    => 'No Sidebar',
			'left-sidebar'  => 'Left Sidebar',
			'right-sidebar' => 'Right Sidebar',
		);

		$sidebar_style_labels = array(
			'default' => 'Default',
			'unboxed' => 'Unboxed',
			'boxed'   => 'Boxed',
		);

		$content_width_labels = array(
			'default' => 'Default',
			'custom'  => 'Custom',
		);

		return Astra_Abilities_Response::success(
			__( 'Retrieved single post settings successfully.', 'astra' ),
			array(
				'container_layout'            => $container_layout,
				'container_layout_label'      => isset( $container_layout_labels[ $container_layout ] ) ? $container_layout_labels[ $container_layout ] : $container_layout,
				'container_style'             => $container_style,
				'container_style_label'       => isset( $container_style_labels[ $container_style ] ) ? $container_style_labels[ $container_style ] : $container_style,
				'sidebar_layout'              => $sidebar_layout,
				'sidebar_layout_label'        => isset( $sidebar_layout_labels[ $sidebar_layout ] ) ? $sidebar_layout_labels[ $sidebar_layout ] : $sidebar_layout,
				'sidebar_style'               => $sidebar_style,
				'sidebar_style_label'         => isset( $sidebar_style_labels[ $sidebar_style ] ) ? $sidebar_style_labels[ $sidebar_style ] : $sidebar_style,
				'content_width'               => $content_width,
				'content_width_label'         => isset( $content_width_labels[ $content_width ] ) ? $content_width_labels[ $content_width ] : $content_width,
				'content_max_width'           => (int) $content_max_width,
				'related_posts_enabled'       => (bool) $related_posts_enabled,
				'related_posts_count'         => (int) $related_posts_count,
				'available_container_layouts' => $container_layout_labels,
				'available_container_styles'  => $container_style_labels,
				'available_sidebar_layouts'   => $sidebar_layout_labels,
				'available_sidebar_styles'    => $sidebar_style_labels,
			)
		);
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.