Skip to content

Commit

Permalink
refactor(activation/gallery): activate links after all other filters
Browse files Browse the repository at this point in the history
* Remove: `$priority` from `Lightbox::_hooks_init()` (no longer used).
  • Loading branch information
Archetyped committed Oct 31, 2020
1 parent d685245 commit 5f96f9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,14 @@ protected function _hooks() {
public function _hooks_init() {
if ( $this->is_enabled() ) {
$cb_hooks_add_last = $this->m( 'hooks_add_last' );
$priority = $this->util->priority( 'low' );

// Init lightbox
add_action( 'wp_footer', $this->m( 'client_footer' ) );
$this->util->add_action( 'footer_script', $this->m( 'client_init' ), 1 );
$this->util->add_filter( 'footer_script', $this->m( 'client_script_media' ), 2 );
// Link activation
add_filter( 'the_content', $cb_hooks_add_last );
add_filter( 'get_post_galleries', $this->m( 'activate_galleries' ), $priority );
add_filter( 'get_post_galleries', $cb_hooks_add_last );
$this->util->add_filter( 'post_process_links', $this->m( 'activate_groups' ), 11 );
$this->util->add_filter( 'validate_uri_regex', $this->m( 'validate_uri_regex_default' ), 1 );
// Content exclusion
Expand Down Expand Up @@ -288,6 +287,9 @@ public function hooks_add_last( $data = null ) {
case 'the_content':
add_filter( $tag, $this->m( 'activate_links' ), $max_priority );
break;
case 'get_post_galleries':
add_filter( $tag, $this->m( 'activate_galleries' ), $max_priority );
break;
case 'dynamic_sidebar':
add_action( $tag, $this->m( 'widget_process_start' ), $max_priority );
break;
Expand Down

0 comments on commit 5f96f9b

Please sign in to comment.