Skip to content

Commit 8d84b92

Browse files
committed
Rename hooks
1 parent 53bbd7a commit 8d84b92

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

THEMES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Friends Themes
2+
3+
Here you can find themes that have been created for the Friends plugin.
4+
5+
- [Mastodon-like interface](https://github.com/akirk/friends-mastodon-like-interface)
6+
7+
If you want to create your own theme, take a look at the [wiki page on Writing Themes](https://github.com/akirk/friends/wiki/Writing-Themes).

includes/class-frontend.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private function register_hooks() {
111111
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
112112
add_action( 'template_redirect', array( $this, 'load_theme' ) );
113113
add_action( 'customize_loaded_components', array( $this, 'ensure_widget_editing' ) );
114-
add_action( 'friends_activate_theme_default', array( $this, 'default_theme' ) );
114+
add_action( 'friends_load_theme_default', array( $this, 'default_theme' ) );
115115
add_action( 'friends_template_paths', array( $this, 'friends_template_paths' ) );
116116
add_action( 'wp_enqueue_scripts', array( $this, 'dequeue_scripts' ), 99999 );
117117
add_action( 'wp_footer', array( $this, 'dequeue_scripts' ) );
@@ -253,17 +253,17 @@ public function load_theme() {
253253
$theme = $post_type_theme;
254254
}
255255
}
256-
if ( ! has_action( 'friends_activate_theme_' . $theme ) ) {
256+
if ( ! has_action( 'friends_load_theme_' . $theme ) ) {
257257
$theme = 'default';
258258
}
259259
$this->theme = $theme;
260-
do_action( 'friends_activate_theme_' . $theme );
260+
do_action( 'friends_load_theme_' . $theme );
261261
}
262262

263263
public function friends_template_paths( $file_paths ) {
264264
$backup_file_paths = $file_paths;
265-
if ( has_filter( 'friends_theme_template_paths_' . $this->theme ) ) {
266-
$file_paths = apply_filters( 'friends_theme_template_paths_' . $this->theme, $file_paths );
265+
if ( has_filter( 'friends_template_paths_theme_' . $this->theme ) ) {
266+
$file_paths = apply_filters( 'friends_template_paths_theme_' . $this->theme, $file_paths );
267267
}
268268
if ( empty( $file_paths ) ) {
269269
return $backup_file_paths;

templates/admin/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
<select name="friends_frontend_theme_<?php echo esc_attr( $post_type_slug ); ?>" id="frontend-theme-<?php echo esc_attr( $post_type_slug ); ?>">
264264
<option value=""><?php esc_html_e( 'Main Theme', 'friends' ); ?></option>
265265
<?php foreach ( Friends\Frontend::get_themes() as $theme => $theme_name ) : ?>
266-
<option value="<?php echo esc_attr( $theme ); ?>"<?php selected( $args[ 'frontend_theme_' . $post_type ], $theme ); ?>><?php echo esc_html( $theme_name ); ?></option>
266+
<option value="<?php echo esc_attr( $theme ); ?>"<?php selected( $args[ 'frontend_theme_' . $post_type_slug ], $theme ); ?>><?php echo esc_html( $theme_name ); ?></option>
267267
<?php endforeach; ?>
268268
</select>
269269
</td>

0 commit comments

Comments
 (0)