PluginProbe
WPSSO Core – Complete Schema Markup and Meta Tags / 22.7.0
WPSSO Core – Complete Schema Markup and Meta Tags v22.7.0
22.7.0 22.6.1 22.6.0 22.5.3 22.5.2 22.5.1 22.4.0 22.3.0 22.2.1 22.2.0 22.1.3 22.1.2 22.1.1 22.1.0 22.0.0 21.13.3 21.13.2 trunk 21.13.1
wpsso / lib / integ / seo / wpmetaseo.php

wpmetaseo.php in WPSSO Core – Complete Schema Markup and Meta Tags 22.7.0, at lib/integ/seo/wpmetaseo.php

90 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * License: GPLv3
4 * License URI: https://www.gnu.org/licenses/gpl.txt
5 * Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/)
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9
10 die( 'These aren\'t the droids you\'re looking for.' );
11 }
12
13 /*
14 * Integration module for the WP Meta SEO plugin.
15 *
16 * See https://wordpress.org/plugins/wp-meta-seo/.
17 */
18 if ( ! class_exists( 'WpssoIntegSeoWpMetaSeo' ) ) {
19
20 class WpssoIntegSeoWpMetaSeo {
21
22 private $p; // Wpsso class object.
23
24 private $hs;
25 private $hs_it;
26 private $opts = null;
27
28 public function __construct( &$plugin ) {
29
30 $this->p =& $plugin;
31
32 if ( $this->p->debug->enabled ) {
33
34 $this->p->debug->mark();
35 }
36
37 $this->p->util->add_plugin_filters( $this, array(
38 'title_seed' => 5,
39 'description_seed' => 4,
40 ), 100 );
41 }
42
43 public function filter_title_seed( $title_text, $mod, $num_hashtags, $md_key, $title_sep ) {
44
45 if ( $this->p->debug->enabled ) {
46
47 $this->p->debug->mark();
48 }
49
50 if ( $mod[ 'is_post' ] ) {
51
52 $meta_key = '_metaseo_metatitle';
53
54 } elseif ( $mod[ 'is_term' ] ) {
55
56 $meta_key = 'wpms_category_metatitle';
57
58 } else { // Nothing to do.
59
60 return $title_text;
61 }
62
63 return WpssoAbstractWpMeta::get_mod_meta( $mod, $meta_key, $single = true );
64 }
65
66 public function filter_description_seed( $desc_text, $mod, $num_hashtags, $md_key ) {
67
68 if ( $this->p->debug->enabled ) {
69
70 $this->p->debug->mark();
71 }
72
73 if ( $mod[ 'is_post' ] ) {
74
75 $meta_key = '_metaseo_metadesc';
76
77 } elseif ( $mod[ 'is_term' ] ) {
78
79 $meta_key = 'wpms_category_metadesc';
80
81 } else { // Nothing to do.
82
83 return $desc_text;
84 }
85
86 return WpssoAbstractWpMeta::get_mod_meta( $mod, $meta_key, $single = true );
87 }
88 }
89 }
90