Done like this:
function cat_filter($args) {
if (count($args) < 10) {
return $args;
}
$new = new WP_Term((object)[
'term_id' => -17,
'name' => 'Blog',
'slug' => 'blog',
'taxonomy' => 'category',
]);
array_splice($args, -5, 0, [$new]);
return $args;
}
add_filter('get_terms', 'cat_filter', 10, 1);
add_filter('term_link', function( $url, $term, $taxonomy ) {
if ( $term->term_id == -17 ) {
$url = "https://example.com";
}
return $url;
}, 10, 3);
Related Posts:
- Translate widget titles using qTranslate plugin
- Get a list of all Widgets registered in WordPress admin widgets-area
- How Do I Add Custom CSS To Only Certain Widgets
- Prevent second widget activation
- How can I add links to widget titles?
- How to add Custom Fields to Settings in Widget Options for all Registered Widgets?
- Remove rss widget title link
- Copy widget settings from one blog to another
- Sidebar Widget Registration without a name, how is it assigned to new named sidebar widget?
- How to Make a Custom Dashboard Widget to Display Custom Notification from Admin?
- Add thumbnail to recent posts widget using filters
- Is there a way to allow only certain type of widgets in the sidebars?
- Shortcode in Text Widget not working
- Why wordpress popular post widget shows Undefined index?
- List sidebars on a page
- How to enable / use new video / audio / images widgets in WordPress 4.8?
- Searching for a better Twitter widget
- Latest/Recent posts widget title link
- Insert Widget option into mark-up with register_sidebar
- Widgets not expanding on wordpress 3.3 widget dashbord
- How do i display the built-in gallery inside a widget?
- Forcing the title of a text widget on to a new line in the admin area
- Removing default theme widgets
- Sidebar not show customizer!
- wp_register_sidebar_widget() disappered my Widgets submenu – what am I doing wrong?
- Display single widget
- Customizing wordpress default widgets?
- different class (css) for sidebar widgets
- Adding widgets with Featured Image via the Customizer run hundreds of queries
- how to put functions inside of widgets
- Adding a Widget : what to put in plugin URL
- How to list all custom post types in a custom widget?
- How can I assign widgets from WP to appear in bbpress?
- get_option returns undesired blank instance of a widget
- escaping and sanitizing input for custom widget form fields
- Dynamic created widget id value of multi-instance in jQuery
- Adding Widgets to Draft Pages
- How to select multiple media files for a widget form?
- Create an extra Widget Areas in WordPress TwentyTwelve
- Apply code for all else first block
- How i can widget ID get after drag for wordpress with jquery?
- FTP Widget Location
- Turn off “This is the Primary Sidebar Widget Area” message
- dynamic sidebar in front page
- Adding a WordPress Widget to a settings page
- How to change “Call To +1800090098” in TopStore pro theme [closed]
- How to dynamically add the the input text field in widget?
- Header Sidebar Won’t Move Lower – Want to Align with Header Logo [closed]
- display widget checkbox selection on frontend
- Enabled checkbox by default in WordPress widgets
- Is there a way to use get_sidebar() when no widgets are activated?
- Is there any tab widget plugin supporting third party widgets? [closed]
- Add footer widgets
- modifying title (in dashboard) for different widget instances
- How to translate Widget Description in constructor?
- Custom CSS for a particular text/html widget in WordPress
- Removing side bar widgets from GovPress theme
- Adding a single text input field to a custom Dashboard widget
- how to show only particular category post in archive widgets
- How do I customize the positioning of WordPress widgets?
- Limit archive widget results
- How can I detemine the parameters needed by the_widget()?
- How do I add a small excerpt of a blog post on my Front Page Recent Posts widget?
- WordPress 5.8 : display new widget
- Determine if a specific Gutenberg block is used on pages/posts
- Mobile view: how to remove right/left margin from the specific widgets?
- Sorting Tag Cloud by Popularity
- My theme didn’t appear sidebar area
- How to customize WordPress dashboard for different users?
- wp_list_widget_controls() undefined
- Force update widget customizer using js
- Use customizer or sidebar for header settings?
- Script in sidebar blocks other widget’s load
- WordPress version quick check?
- Can I get variable into dynamic sidebar?
- How to show a widget for logged-in users only?
- Can’t output the number 0 in widget
- widget exclude post by custom field
- if is within sidebar [duplicate]
- Diplaying widgets causes responsive slider to not show up
- iframe not being displayed in a widget
- how to call new widgets in sidebar in custom theme?
- Run an action only when Widget actually instantiated (not just registered)
- My blog has a design issue.
- Call sidebar from a template
- Strange widget behavior
- WordPress Widgets no drop down
- WordPress RSS widget and Yahoo Pipes
- Jetpack ‘Blog Subscription’ widget doesn’t add emails to
- Putting a URL, for a preview, in a side bar
- Full Width Container Colour Problems
- How to make custom dashboard widget to display alert in front-end?
- how to enable full width page template in woo theme memorable?
- Can’t remove a widget from admin
- Add a twitter feed to my WordPress website
- Using AJAX in a Widget to Sort items [closed]
- How to create a dashboard to show current user analytics in buddypress
- How to inject a virtual widget (i.e. without adding it to the database) to the sidebar
- SVG Icon Code Support in WordPress Custom Html Widget? Not Working
- Remove nofollow attribute from social widget links