Change page title from plugin

There’s a filter for that: function wpse_alter_title( $title, $id ) { // $id = $post->ID; // alter the title here return $title; } If you want to alter the “Protected” and “Private” titles, then you need other filters: // Preserve the “%s” – else the title will be removed. function wpse_alter_protected_title_format( $title ) { return … Read more

Changing “Enter title here” based on post format

You need to do the following; jQuery(document).ready(function( $ ) { $(‘input.post-format’).click(function(){ $(‘#title-prompt-text’).val( $(this).next(‘label’).text()); }) }); This will replace the title with whichever post format you select. Save the above into a file called custom-post-title.js and you will need to place this file into your theme folder. Either in the root or within a folder named … Read more

Set post title from two meta fields

You are using wrong variable on the following line: $data[‘post_title’] = $post_title; you should use $event_title in $post_title as following: $data[‘post_title’] = $event_title; Also Get Post ID from $postarr parameter. Updated Code : function set_event_title( $data , $postarr ) { if($data[‘post_type’] == ‘events’) { $event_date = get_post_meta($postarr[‘ID’],’event_datetime’,true); $event_venue = get_post_meta($postarr[‘ID’], ‘venue_name’ , true); $event_title = … Read more

Anyway to edit the titlebar of WordPress Widgets in the Admin area?

I believe you are looking for $params = apply_filters( ‘dynamic_sidebar_params’, $params ); (look here: https://github.com/WordPress/WordPress/blob/master/wp-includes/widgets.php#L706). Now this filter will evaluate both in front end and back end. so to answer your question, you could wrap your filter in a if( is_admin() ){ // Do icons } check. Better yet, you could define this at registration … Read more

REQUIRED: The theme must not used the tags. | REQUIRED: The theme must not call to wp_title()

WordPress added support for the title-tag feature in version 4.1 and it’s now a required feature for themes uploaded to the repo. To implement this feature, make sure your theme does not have the title tag hard coded within header.php, e.g.: <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title> Configure your theme with title-tag support like … Read more

Empty title on front page/Home

The title is empty at the front page in WordPress. Yes, that sucks. Just put the separator into wp_title(): <title><?php // separator, print immediately, separator position wp_title( ‘·’, TRUE, ‘right’ ); bloginfo( ‘name’ ); ?></title> This prints out just the blog name on the front page and PAGE NAME · BLOG NAME on other pages.

Dynamically update post title in admin page

The block editor is restoring back the title that was last saved (or typed manually into the textarea), so with the block editor, you can change the title dynamically using this code: wp.data.dispatch( ‘core/editor’ ).editPost( { title: ‘Title here’ } ) PS: You should make sure your JS file has the wp-editor, wp-edit-post or wp-data … Read more

Changing title to lowercase [closed]

Assuming this question is related to WordPress, here is answer :- You can update the titles directly into your mySQL database using simple update function. one of my user publishs all his posts uppercase (title) i want to edit them and make it normal. – Using some conditional statements as I mentioned in this code, … Read more