/
home
/
techb158
/
public_html
/
wp-content
/
plugins
/
wordpress-seo
/
inc
/
/home/techb158/public_html/wp-content/plugins/wordpress-seo/inc
mkdir
upload
Name
Size
Mode
Actions
exceptions/
-
0755
rm
options/
-
0755
rm
sitemaps/
-
0755
rm
class-addon-manager.php
27180
0644
edit
dl
rm
class-my-yoast-api-request.php
5518
0644
edit
dl
rm
class-post-type.php
3986
0644
edit
dl
rm
class-rewrite.php
7763
0644
edit
dl
rm
class-upgrade-history.php
3118
0644
edit
dl
rm
class-upgrade.php
56628
0644
edit
dl
rm
class-wpseo-admin-bar-menu.php
29536
0644
edit
dl
rm
class-wpseo-content-images.php
2655
0644
edit
dl
rm
class-wpseo-custom-fields.php
2489
0644
edit
dl
rm
class-wpseo-custom-taxonomies.php
1630
0644
edit
dl
rm
class-wpseo-image-utils.php
15391
0644
edit
dl
rm
class-wpseo-installation.php
1201
0644
edit
dl
rm
class-wpseo-meta.php
38060
0644
edit
dl
rm
class-wpseo-primary-term.php
1739
0644
edit
dl
rm
class-wpseo-rank.php
7560
0644
edit
dl
rm
class-wpseo-replace-vars.php
52699
0644
edit
dl
rm
class-wpseo-replacement-variable.php
1375
0644
edit
dl
rm
class-wpseo-shortlinker.php
1132
0644
edit
dl
rm
class-wpseo-statistics.php
1443
0644
edit
dl
rm
class-wpseo-utils.php
29702
0644
edit
dl
rm
class-yoast-dynamic-rewrites.php
5361
0644
edit
dl
rm
date-helper.php
1752
0644
edit
dl
rm
index.php
38
0644
edit
dl
rm
interface-wpseo-wordpress-ajax-integration.php
294
0644
edit
dl
rm
interface-wpseo-wordpress-integration.php
348
0644
edit
dl
rm
language-utils.php
1313
0644
edit
dl
rm
wpseo-functions-deprecated.php
68
0644
edit
dl
rm
wpseo-functions.php
9218
0644
edit
dl
rm
wpseo-non-ajax-functions.php
1593
0644
edit
dl
rm
Edit:
/home/techb158/public_html/wp-content/plugins/wordpress-seo/inc/class-wpseo-primary-term.php
(1739B)
<?php /** * WPSEO plugin file. * * @package WPSEO */ /** * Represents a post's primary term. */ class WPSEO_Primary_Term { /** * Taxonomy name for the term. * * @var string */ protected $taxonomy_name; /** * Post ID for the term. * * @var int */ protected $post_ID; /** * The taxonomy this term is part of. * * @param string $taxonomy_name Taxonomy name for the term. * @param int $post_id Post ID for the term. */ public function __construct( $taxonomy_name, $post_id ) { $this->taxonomy_name = $taxonomy_name; $this->post_ID = $post_id; } /** * Returns the primary term ID. * * @return int|bool */ public function get_primary_term() { $primary_term = get_post_meta( $this->post_ID, WPSEO_Meta::$meta_prefix . 'primary_' . $this->taxonomy_name, true ); if ( ! $primary_term ) { return false; } $terms = $this->get_terms(); if ( ! in_array( (int) $primary_term, wp_list_pluck( $terms, 'term_id' ), true ) ) { $primary_term = false; } $primary_term = (int) $primary_term; return ( $primary_term ) ? ( $primary_term ) : false; } /** * Sets the new primary term ID. * * @param int $new_primary_term New primary term ID. * * @return void */ public function set_primary_term( $new_primary_term ) { update_post_meta( $this->post_ID, WPSEO_Meta::$meta_prefix . 'primary_' . $this->taxonomy_name, $new_primary_term ); } /** * Get the terms for the current post ID. * When $terms is not an array, set $terms to an array. * * @return array */ protected function get_terms() { $terms = get_the_terms( $this->post_ID, $this->taxonomy_name ); if ( ! is_array( $terms ) ) { $terms = []; } return $terms; } }
Save
cmd:
run