Remove shortcode aliases

This commit is contained in:
Tetrakern 2024-10-07 02:17:33 +02:00
parent 8bd7342efd
commit 6390822b91
3 changed files with 7 additions and 22 deletions

View File

@ -51,7 +51,7 @@ For simplicity, here is the copied content of the [demo homepage](https://fictio
<!-- /wp:heading --> <!-- /wp:heading -->
<!-- wp:shortcode --> <!-- wp:shortcode -->
[fictioneer_chapter_cards count="6"] [fictioneer_latest_chapters count="6"]
<!-- /wp:shortcode --> <!-- /wp:shortcode -->
<!-- wp:heading --> <!-- wp:heading -->

View File

@ -755,7 +755,7 @@ For simplicity, here is the copied content of the demo home page (minus some sit
<!-- /wp:heading --> <!-- /wp:heading -->
<!-- wp:shortcode --> <!-- wp:shortcode -->
[fictioneer_chapter_cards count="6"] [fictioneer_latest_chapters count="6"]
<!-- /wp:shortcode --> <!-- /wp:shortcode -->
<!-- wp:heading --> <!-- wp:heading -->

View File

@ -100,7 +100,7 @@ function fictioneer_update_shortcode_relationships( $post_id, $post ) {
} }
// Look for post-related shortcode // Look for post-related shortcode
if ( str_contains( $post->post_content, 'fictioneer_latest_post' ) ) { if ( str_contains( $post->post_content, 'fictioneer_latest_posts' ) ) {
$registry['ref_posts'][ $post_id ] = 'shortcode'; $registry['ref_posts'][ $post_id ] = 'shortcode';
} else { } else {
unset( $registry['ref_posts'][ $post_id ] ); unset( $registry['ref_posts'][ $post_id ] );
@ -109,8 +109,7 @@ function fictioneer_update_shortcode_relationships( $post_id, $post ) {
// Look for chapter-related shortcodes // Look for chapter-related shortcodes
if ( if (
str_contains( $post->post_content, 'fictioneer_chapter_list' ) || str_contains( $post->post_content, 'fictioneer_chapter_list' ) ||
str_contains( $post->post_content, 'fictioneer_latest_chapter' ) || str_contains( $post->post_content, 'fictioneer_latest_chapters' )
str_contains( $post->post_content, 'fictioneer_chapter_cards' )
) { ) {
$registry['ref_chapters'][ $post_id ] = 'shortcode'; $registry['ref_chapters'][ $post_id ] = 'shortcode';
} else { } else {
@ -119,10 +118,8 @@ function fictioneer_update_shortcode_relationships( $post_id, $post ) {
// Look for story-related shortcodes // Look for story-related shortcodes
if ( if (
str_contains( $post->post_content, 'fictioneer_latest_stor' ) || str_contains( $post->post_content, 'fictioneer_latest_stories' ) ||
str_contains( $post->post_content, 'fictioneer_story_cards' ) || str_contains( $post->post_content, 'fictioneer_latest_updates' )
str_contains( $post->post_content, 'fictioneer_latest_update' ) ||
str_contains( $post->post_content, 'fictioneer_update_cards' )
) { ) {
$registry['ref_stories'][ $post_id ] = 'shortcode'; $registry['ref_stories'][ $post_id ] = 'shortcode';
} else { } else {
@ -130,10 +127,7 @@ function fictioneer_update_shortcode_relationships( $post_id, $post ) {
} }
// Look for recommendation-related shortcodes // Look for recommendation-related shortcodes
if ( if ( str_contains( $post->post_content, 'fictioneer_latest_recommendations' ) ) {
str_contains( $post->post_content, 'fictioneer_latest_recommendation' ) ||
str_contains( $post->post_content, 'fictioneer_recommendation_cards' )
) {
$registry['ref_recommendations'][ $post_id ] = 'shortcode'; $registry['ref_recommendations'][ $post_id ] = 'shortcode';
} else { } else {
unset( $registry['ref_recommendations'][ $post_id ] ); unset( $registry['ref_recommendations'][ $post_id ] );
@ -591,8 +585,6 @@ function fictioneer_shortcode_latest_chapters( $attr ) {
return $html; return $html;
} }
add_shortcode( 'fictioneer_latest_chapters', 'fictioneer_shortcode_latest_chapters' ); add_shortcode( 'fictioneer_latest_chapters', 'fictioneer_shortcode_latest_chapters' );
add_shortcode( 'fictioneer_latest_chapter', 'fictioneer_shortcode_latest_chapters' ); // Alias
add_shortcode( 'fictioneer_chapter_cards', 'fictioneer_shortcode_latest_chapters' ); // Alias
// ============================================================================= // =============================================================================
// LATEST STORIES SHORTCODE // LATEST STORIES SHORTCODE
@ -698,8 +690,6 @@ function fictioneer_shortcode_latest_stories( $attr ) {
return $html; return $html;
} }
add_shortcode( 'fictioneer_latest_stories', 'fictioneer_shortcode_latest_stories' ); add_shortcode( 'fictioneer_latest_stories', 'fictioneer_shortcode_latest_stories' );
add_shortcode( 'fictioneer_latest_story', 'fictioneer_shortcode_latest_stories' ); // Alias
add_shortcode( 'fictioneer_story_cards', 'fictioneer_shortcode_latest_stories' ); // Alias
// ============================================================================= // =============================================================================
// LATEST UPDATES SHORTCODE // LATEST UPDATES SHORTCODE
@ -808,8 +798,6 @@ function fictioneer_shortcode_latest_story_updates( $attr ) {
return $html; return $html;
} }
add_shortcode( 'fictioneer_latest_updates', 'fictioneer_shortcode_latest_story_updates' ); add_shortcode( 'fictioneer_latest_updates', 'fictioneer_shortcode_latest_story_updates' );
add_shortcode( 'fictioneer_latest_update', 'fictioneer_shortcode_latest_story_updates' ); // Alias
add_shortcode( 'fictioneer_update_cards', 'fictioneer_shortcode_latest_story_updates' ); // Alias
// ============================================================================= // =============================================================================
// LATEST RECOMMENDATIONS SHORTCODE // LATEST RECOMMENDATIONS SHORTCODE
@ -901,8 +889,6 @@ function fictioneer_shortcode_latest_recommendations( $attr ) {
return $html; return $html;
} }
add_shortcode( 'fictioneer_latest_recommendations', 'fictioneer_shortcode_latest_recommendations' ); add_shortcode( 'fictioneer_latest_recommendations', 'fictioneer_shortcode_latest_recommendations' );
add_shortcode( 'fictioneer_latest_recommendation', 'fictioneer_shortcode_latest_recommendations' ); // Alias
add_shortcode( 'fictioneer_recommendation_cards', 'fictioneer_shortcode_latest_recommendations' ); // Alias
// ============================================================================= // =============================================================================
// LATEST POST SHORTCODE // LATEST POST SHORTCODE
@ -960,7 +946,6 @@ function fictioneer_shortcode_latest_posts( $attr ) {
return $html; return $html;
} }
add_shortcode( 'fictioneer_latest_posts', 'fictioneer_shortcode_latest_posts' ); add_shortcode( 'fictioneer_latest_posts', 'fictioneer_shortcode_latest_posts' );
add_shortcode( 'fictioneer_latest_post', 'fictioneer_shortcode_latest_posts' ); // Alias
// ============================================================================= // =============================================================================
// BOOKMARKS SHORTCODE // BOOKMARKS SHORTCODE