PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.8
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / inc / ExternalPlugin / RankMath / LPRankMath.php

LPRankMath.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.3.8, at inc/ExternalPlugin/RankMath/LPRankMath.php

46 lines 924 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class LPYoastSeo
4 *
5 * Compatible with wordpress.org/plugins/wordpress-seo/
6 * @since 4.2.7.7
7 * @version 1.0.0
8 */
9 namespace LearnPress\ExternalPlugin\RankMath;
10
11 use LearnPress\Helpers\Singleton;
12 use LearnPress\Models\CourseModel;
13 use LP_Helper;
14 use LP_Page_Controller;
15
16 class LPRankMath {
17 use Singleton;
18
19 public function init() {
20 add_filter(
21 'rank_math/sitemap/exclude_post_type',
22 [ $this, 'disable_link_sitemap_with_items_course' ],
23 10,
24 2
25 );
26 }
27
28 /**
29 * Disable link sitemap with items course (lesson, quiz, question)
30 *
31 * @param $bool
32 * @param $post_type
33 *
34 * @return bool
35 */
36 public function disable_link_sitemap_with_items_course( $bool, $post_type ) {
37 $item_types = CourseModel::item_types_support();
38 $item_types[] = LP_QUESTION_CPT;
39 if ( in_array( $post_type, $item_types ) ) {
40 $bool = true;
41 }
42
43 return $bool;
44 }
45 }
46