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 1 commit
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
10 changes: 10 additions & 0 deletions includes/theme-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,14 @@ 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 do_action( 'benenson_settings_before_form' ); ?>

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

Expand Down Expand Up @@ -222,6 +227,7 @@ function benenson_theme_option_admin_page() {
<input type="url" name="_social_instagram" value="<?php echo esc_attr( $value ); ?>" placeholder="https://">
</td>
</tr>
<?php do_action( 'benenson_settings_social' ); ?>
</table>

<h2><?php esc_html_e( 'Analytics', 'benenson' ); ?></h2>
Expand All @@ -240,6 +246,7 @@ 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 do_action( 'benenson_settings_analytics' ); ?>
</table>

<h2><?php esc_html_e( 'Sidebar', 'benenson' ); ?></h2>
Expand Down Expand Up @@ -283,6 +290,7 @@ function benenson_theme_option_admin_page() {
</select>
</td>
</tr>
<?php do_action( 'benenson_settings_sidebar' ); ?>
</table>

<h2><?php esc_html_e( 'Search', 'benenson' ); ?></h2>
Expand All @@ -301,6 +309,7 @@ function benenson_theme_option_admin_page() {
<input type="checkbox" name="_search_navigation_disabled" <?php echo esc_attr( $value ); ?> />
</td>
</tr>
<?php do_action( 'benenson_settings_search' ); ?>
</table>

<h2><?php esc_html_e( 'Logo', 'benenson' ); ?></h2>
Expand Down Expand Up @@ -333,6 +342,7 @@ function benenson_theme_option_admin_page() {
<input type="url" name="_logo_url" value="<?php echo esc_attr( $value ); ?>" placeholder="https://">
</td>
</tr>
<?php do_action( 'benenson_settings_logo' ); ?>
</table>
<?php submit_button(); ?>
</form>
Expand Down