Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move generic site data into self contained objects. #21368

Open
wants to merge 7 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
CS.
  • Loading branch information
thijsoo committed May 30, 2024
commit b977e057b160f996fbaaa1a8ff70d253caaa4b17
2 changes: 1 addition & 1 deletion admin/metabox/class-metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ public function enqueue() {
*
* @var $repo Website_Information_Repository
*/
$repo = YoastSEO()->classes->get( Website_Information_Repository::class );
$repo = YoastSEO()->classes->get( Website_Information_Repository::class );
$site_information = $repo->get_post_site_information();
$site_information->set_permalink( $this->get_permalink() );
$script_data = array_merge_recursive( $site_information->get_legacy_site_information(), $script_data );
Expand Down
2 changes: 1 addition & 1 deletion admin/taxonomy/class-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function admin_enqueue_scripts() {
*
* @var $repo Website_Information_Repository
*/
$repo = YoastSEO()->classes->get( Website_Information_Repository::class );
$repo = YoastSEO()->classes->get( Website_Information_Repository::class );
$term_information = $repo->get_term_site_information();
$term_information->set_term( get_term_by( 'id', $tag_id, $this::get_taxonomy() ) );
$script_data = array_merge_recursive( $term_information->get_site_information(), $script_data );
Expand Down
1 change: 0 additions & 1 deletion src/editors/framework/site/base-site-information.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Exception;
use Yoast\WP\SEO\Actions\Alert_Dismissal_Action;
use Yoast\WP\SEO\Editors\Domain\Site\Site_Information_Interface;
use Yoast\WP\SEO\Helpers\Product_Helper;
use Yoast\WP\SEO\Helpers\Short_Link_Helper;
use Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository;
Expand Down
8 changes: 4 additions & 4 deletions src/editors/framework/site/post-site-information.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function get_legacy_site_information(): array {
'webinarIntroBlockEditorUrl' => $this->short_link_helper->get( 'https://yoa.st/webinar-intro-block-editor' ),
'blackFridayBlockEditorUrl' => ( $this->promotion_manager->is( 'black-friday-2023-checklist' ) ) ? $this->short_link_helper->get( 'https://yoa.st/black-friday-checklist' ) : '',

'metabox' => [
'metabox' => [
'search_url' => $this->search_url(),
'post_edit_url' => $this->edit_url(),
'base_url' => $this->base_url_for_js(),
Expand All @@ -62,9 +62,9 @@ public function get_site_information(): array {
'currentPromotions' => $this->promotion_manager->get_current_promotions(),
'webinarIntroBlockEditorUrl' => $this->short_link_helper->get( 'https://yoa.st/webinar-intro-block-editor' ),
'blackFridayBlockEditorUrl' => ( $this->promotion_manager->is( 'black-friday-2023-checklist' ) ) ? $this->short_link_helper->get( 'https://yoa.st/black-friday-checklist' ) : '',
'search_url' => $this->search_url(),
'post_edit_url' => $this->edit_url(),
'base_url' => $this->base_url_for_js(),
'search_url' => $this->search_url(),
'post_edit_url' => $this->edit_url(),
'base_url' => $this->base_url_for_js(),
];

return \array_merge( $data, parent::get_site_information() );
Expand Down