', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'anews_pingback_header' ); if ( !function_exists( 'anews_next_prev_post_link' ) ) { function anews_next_prev_post_link() {?>
1 ) { $comment_text = $comments_number . esc_html__( ' Comments', 'anews' ); } echo esc_html( $comment_text ); } } /** * anews_move_comment_field_to_bottom() Remove cookie field and move comment field bottom. * @param $fields array() * @return return comment form fields */ function anews_move_comment_field_to_bottom( $fields ) { $comment_field = $fields['comment']; unset( $fields['comment'] ); unset( $fields['cookies'] ); $fields['comment'] = $comment_field; return $fields; } add_filter( 'comment_form_fields', 'anews_move_comment_field_to_bottom' ); if ( !function_exists( 'anews_comments_pagination' ) ) { function anews_comments_pagination() { the_comments_pagination( array( 'screen_reader_text' => ' ', 'prev_text' => '', 'next_text' => '', 'type' => 'list', 'mid_size' => 1, ) ); } } if ( !function_exists('anews_pagination') ) { function anews_pagination(){ the_posts_pagination(array( 'screen_reader_text' => '', 'prev_text' => '', 'next_text' => '', 'type' => 'list', 'mid_size' => 1, )); } } /** * List of posts for post choices. * @return Array Array of post ids and name. */ function anews_post_choices() { $posts = get_posts( array( 'numberposts' => -1 ) ); $choices = array(); $choices[0] = esc_html__( '--Select--', 'anews' ); foreach ( $posts as $post ) { $choices[ $post->ID ] = $post->post_title; } return $choices; } /** * List of category for category choices. * @return Array Array of post ids and name. */ function anews_category_choices() { $tax_args = array( 'hierarchical' => 0, 'taxonomy' => 'category', ); $taxonomies = get_categories( $tax_args ); $choices = array(); $choices[0] = esc_html__( '--Select--', 'anews' ); foreach ( $taxonomies as $tax ) { $choices[ $tax->term_id ] = $tax->name; } return $choices; } /** * Delete the `Hello world!` post after successful demo import. */ function anews_delete_hello_world() { $post = get_page_by_path('hello-world', OBJECT, 'post'); if ($post) { wp_delete_post($post->ID,true); } } add_filter( 'ocdi/import_files', 'anews_delete_hello_world' );