Learndash_Helpers::all_ld_topics( string $label = null, string $option_code = 'LDTOPIC' )
Contents
Parameters Parameters
- $label
-
(Optional)
Default value: null
- $option_code
-
(Optional)
Default value: 'LDTOPIC'
Return Return
(mixed)
Source Source
File: src/integrations/learndash/helpers/learndash-helpers.php
public function all_ld_topics( $label = null, $option_code = 'LDTOPIC' ) { if ( ! $this->load_options ) { return Automator()->helpers->recipe->build_default_options_array( $label, $option_code ); } if ( ! $label ) { $label = esc_attr__( 'Topic', 'uncanny-automator' ); } $args = [ 'post_type' => 'sfwd-topic', 'posts_per_page' => 9999, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => 'publish', ]; $options = Automator()->helpers->recipe->options->wp_query( $args, true, esc_attr__( 'Any topic', 'uncanny-automator' ) ); $option = [ 'option_code' => $option_code, 'label' => $label, 'input_type' => 'select', 'required' => true, 'options' => $options, 'relevant_tokens' => [ $option_code => esc_attr__( 'Topic title', 'uncanny-automator' ), $option_code . '_ID' => esc_attr__( 'Topic ID', 'uncanny-automator' ), $option_code . '_URL' => esc_attr__( 'Topic URL', 'uncanny-automator' ), ], 'custom_value_description' => _x( 'Topic ID', 'LearnDash', 'uncanny-automator' ), ]; return apply_filters( 'uap_option_all_ld_topics', $option ); }
Expand full source code Collapse full source code View on Github