• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Featured_Content::delete_post_tag() – Reset tag option when the saved tag is deleted.

You appear to be a bot. Output may be restricted

Description

Reset tag option when the saved tag is deleted.

It's important to mention that the transient needs to be deleted, too. While it may not be obvious by looking at the function alone, the transient is deleted by Featured_Content::validate_settings(). Hooks in the "delete_post_tag" action.

Usage

Featured_Content::delete_post_tag( $tag_id );

Parameters

$tag_id
( int ) required – The term_id of the tag that has been deleted.

Returns

void

Source

File name: twentyfourteen/inc/featured-content.php
Lines:

1 to 11 of 11
  public static function delete_post_tag( $tag_id ) {
    $settings = self::get_setting();

    if ( empty( $settings['tag-id'] ) || $tag_id != $settings['tag-id'] ) {
      return;
    }

    $settings['tag-id'] = 0;
    $settings           = self::validate_settings( $settings );
    update_option( 'featured-content', $settings );
  }
 

 View on Trac

Published: 19th December 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: Featured_Content::delete_post_tag
Class ref: Featured_Content
Plugin ref: Twenty Fourteen
Version: 3.5
Sourcefile: inc/featured-content.php
File ref: inc/featured-content.php
Deprecated?: No
API Letters: C,D,F,P,T

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites