<?php

// includes/gle-options-studiopress

/**
 * Prevent direct access to this file.
 *
 * @since 1.7.0
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit( 'Sorry, you are not allowed to access this file directly.' );
}


/**
 * Third meta box - optional: setting up the setting fields & labels.
 *    For supported 'StudioPress' child themes with CPTs.
 *
 * @since 1.6.0
 *
 * @see   DDW_GLE_Plugin_Settings::help() in /includes/gle-admin-options.php
 *
 * @uses  post_type_exists()
 * @uses  ddw_genesis_layout_extras_option()
 */
function ddw_genesis_layout_extras_box_studiopress() {

	/** Description - user info: Child Theme generated special Custom Post Type sections */
	echo '<h4>' . __( 'Special Custom Post Type Sections', 'genesis-layout-extras' ) . '</h4>';

		echo '<p><span class="description">' . __( 'Here you can set up a <strong>default</strong> layout option for various extra archive pages generated by Custom Post Types which were set by child themes.', 'genesis-layout-extras' ) . ' ' . sprintf(
				/* translators: %1$s - opening HTML code tag / %2$s - closing HTML code tag / %3$s - label "Genesis layout settings" */
				__( '%1$sGenesis Default%2$s in the drop-down menus below always means the chosen default layout option in the regular %3$s.', 'genesis-layout-extras' ),
				'<code style="font-style: normal; color: #333;">',
				'</code>',
				'<a href="' . esc_url( admin_url( 'admin.php?page=genesis#genesis-theme-settings-layout' ) ) . '">' . __( 'Genesis layout settings', 'genesis-layout-extras' ) . '</a>'
			) . '</span></p>';

	/** Child Themes: Minimum 2.0 / Executive 2.0 */
	if ( post_type_exists( 'portfolio' )
		&& ( function_exists( 'minimum_portfolio_post_type' ) || function_exists( 'executive_portfolio_post_type' ) )
	) {

		if ( function_exists( 'minimum_portfolio_post_type' ) ) {
			$gle_sp_theme_check = 'Minimum 2.0';
		} elseif ( function_exists( 'executive_portfolio_post_type' ) ) {
			$gle_sp_theme_check = 'Executive 2.0';
		}

		$gle_sp_theme = sprintf(
			/* translators: %s - name of a child theme, "Minimum 2.0" OR "Executive 2.0" */
			__( 'Child Theme: %s by StudioPress', 'genesis-layout-extras' ),
			$gle_sp_theme_check
		);

		echo '<hr class="div" />';

		echo '<h4>' . $gle_sp_theme . '</h4>';

			ddw_genesis_layout_extras_option(
				__( 'Portfolio Post Type Layout (archive)', 'genesis-layout-extras' ) . ': ',
				'ddw_genesis_layout_cpt_studiopress_portfolio'
			);

			ddw_gle_save_button();

	}  // end-if studiopress portfolio check

}  // end function
