diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index b83cba69..08dab6e5 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -52,13 +52,14 @@ public function register_shortcode_ui( $shortcode_tag, $args = array() ) { } public function get_shortcodes() { - return $this->shortcodes; + return apply_filters( 'shortcode_ui_shortcodes', $this->shortcodes ); } public function get_shortcode( $shortcode_tag ) { - if ( isset( $this->shortcodes[ $shortcode_tag ] ) ) { - return $this->shortcodes[ $shortcode_tag ]; + $shortcodes = $this->get_shortcodes(); + if ( isset( $shortcodes[ $shortcode_tag ] ) ) { + return $shortcodes[ $shortcode_tag ]; } } @@ -80,7 +81,7 @@ public function enqueue() { // make sure media library is queued wp_enqueue_media(); - $shortcodes = array_values( $this->shortcodes ); + $shortcodes = array_values( $this->get_shortcodes() ); $screen = get_current_screen(); if ( $screen && ! empty( $screen->post_type ) ) { foreach ( $shortcodes as $key => $args ) {