Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Add actions to settings form template #66

Merged
merged 3 commits into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions includes/theme-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,19 @@ function benenson_theme_option_admin_page() {
array_walk( $posts, function( &$item ) use ( &$sidebar_post_list ) {
$sidebar_post_list[ $item->ID ] = $item->post_title;
} );

$sidebar_post_list = apply_filters( 'benenson_settings_sidebar_post_list', $sidebar_post_list );
?>
<div class="wrap">
<h1><?php esc_html_e( 'Theme Options', 'benenson' ); ?></h1>

<?php
/**
* Fires before the settings form opening tag.
*/
do_action( 'benenson_settings_before_form' );
?>

<form method="post" action="options.php">
<?php settings_fields( 'theme_options' ); ?>

Expand Down Expand Up @@ -222,6 +232,12 @@ function benenson_theme_option_admin_page() {
<input type="url" name="_social_instagram" value="<?php echo esc_attr( $value ); ?>" placeholder="https://">
</td>
</tr>
<?php
/**
* Fires at the end of the table wrapper for social settings.
*/
do_action( 'benenson_settings_social' );
?>
</table>

<h2><?php esc_html_e( 'Analytics', 'benenson' ); ?></h2>
Expand All @@ -240,6 +256,12 @@ function benenson_theme_option_admin_page() {
<input type="text" name="_analytics_ga" value="<?php echo esc_html( $value ); ?>" placeholder="UA-XXXXX-X">
</td>
</tr>
<?php
/**
* Fires at the end of the table wrapper for analytics settings.
*/
do_action( 'benenson_settings_analytics' );
?>
</table>

<h2><?php esc_html_e( 'Sidebar', 'benenson' ); ?></h2>
Expand Down Expand Up @@ -283,6 +305,12 @@ function benenson_theme_option_admin_page() {
</select>
</td>
</tr>
<?php
/**
* Fires at the end of the table wrapper for sidebar settings.
*/
do_action( 'benenson_settings_sidebar' );
?>
</table>

<h2><?php esc_html_e( 'Search', 'benenson' ); ?></h2>
Expand All @@ -301,6 +329,12 @@ function benenson_theme_option_admin_page() {
<input type="checkbox" name="_search_navigation_disabled" <?php echo esc_attr( $value ); ?> />
</td>
</tr>
<?php
/**
* Fires at the end of the table wrapper for search settings
*/
do_action( 'benenson_settings_search' );
?>
</table>

<h2><?php esc_html_e( 'Logo', 'benenson' ); ?></h2>
Expand Down Expand Up @@ -333,6 +367,12 @@ function benenson_theme_option_admin_page() {
<input type="url" name="_logo_url" value="<?php echo esc_attr( $value ); ?>" placeholder="https://">
</td>
</tr>
<?php
/**
* Fires at the end of the table wrapper for logo settings.
*/
do_action( 'benenson_settings_logo' );
?>
</table>
<?php submit_button(); ?>
</form>
Expand Down