PUM_Admin_Upgrade_Routine_6::process_popup_cats_tags()

Checks for popup taxonomy counts and disables popup taxonomies if none are found.


Description Description


Source Source

File: includes/admin/upgrades/class-pum-admin-upgrade-routine-6.php

	public static function process_popup_cats_tags() {
		global $popmake_options;

		// Setup the Popup Taxonomies
		popmake_setup_taxonomies( true );

		$categories =  wp_count_terms( 'popup_category', array( 'hide_empty' => true) );
		$tags =  wp_count_terms( 'popup_tag', array( 'hide_empty' => true) );

		if ( is_wp_error( $tags ) ) {
			$tags = 0;
		}

		if ( is_wp_error( $categories ) ) {
			$categories = 0;
		}

		$popmake_options['disable_popup_category_tag'] = $categories == 0 && $tags == 0;

		update_option( 'popmake_settings', $popmake_options );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.