How would I add a link to the profile editing page of the dashboard?

I assume you mean /wp-admin/profile.php page and want to hide native password fields. Try this (just test if form works ok with it): add_filter( ‘show_password_fields’, ‘modify_profile_password’ ); function modify_profile_password( $show ) { ?> <tr id=”password”> <th>Change your password at</th> <td><a href=””>password change page</a></td> </tr> <?php return false; }

Changing the comments link produced by the get_comments_link() and get_comments_pagenum_link() functions

So the solution to the get_comments_pagenum_link() function is straightforward enough: add_filter(‘get_comments_pagenum_link’ , ‘new_get_comments_pagenum_link’); function new_get_comments_pagenum_link($content) { $content = str_ireplace(‘#comments’ , ‘#other’, $content); return $content; } Which filters the output of get_comments_pagenum_link() to replace #content with #other, or any other string you might choose. For the get_comments_link() function, which can’t be filtered, I have simply discovered … Read more

How to check if upload window came from the featured image link?

There is a filter for the html of the ‘postimagediv’ called ‘admin_post_thumbnail_html’. There may be more elegant ways, but this works: add_filter(‘admin_post_thumbnail_html’, ‘wpse61502_change_thumbnail_link’); function wpse61502_change_thumbnail_link($content) { return str_replace(‘media-upload.php?’, ‘media-upload.php?is_thumbnail=true&’, $content); } In your plugin / script check the querystring: if ( isset($_GET[‘is_thumbnail’]) ) { // do stuff, actions, enqueue, … }

Change Rating range in Link Manager

See the function link_advanced_meta_box() in wp-admin/includes/meta-boxes.php: <td><select name=”link_rating” id=”link_rating” size=”1″> <?php for ( $r = 0; $r <= 10; $r++ ) { echo ‘<option value=”‘ . $r . ‘”‘; if ( isset($link->link_rating) && $link->link_rating == $r ) echo ‘ selected=”selected”‘; echo(‘>’ . $r . ‘</option>’); } ?></select>&nbsp;<?php _e(‘(Leave at 0 for no rating.)’) ?> The … Read more

Confusion about how a URL is being parsed

WordPress uses set of regular expressions to parse urls (so called rewrite rules). It matches them in some order and stops when first matching rule is found. It’s a little bit hard to say what rule is matched in your case. We don’t know what are your permalink settings and what other changes to rewrite … Read more

Best way to add internal link in widget

The page ID can vary in different installation, and it can’t be changed, so an option is to use get_page_by_path because the page slug can be easily changed: <div class=”my-link-box”> <?php $page = get_page_by_path(‘my-page’); ?> <a href=”https://wordpress.stackexchange.com/questions/126876/<?php echo get_permalink($page); ?>”><?php echo $page->post_title; ?></a> </div> However this is not a great solution as well. Once you … Read more

How can you add a link to a sidebar description?

The sidebar description runs through esc_html(), so you cannot pass HTML directly. But you can use the filter esc_html to insert your desired content. Here is a simple example: add_action( ‘widgets_init’, function() { $desc = “Read the <a href=”http://wordpress.stackexchange.com/q/189749/73″>explanation</a>!”; $placeholder=”PLACEHOLDER”; register_sidebar([ ‘id’ => ‘wpse-189749’, ‘name’ => ‘Link description’, ‘description’ => $placeholder ]); add_action( ‘widgets_admin_page’, function() … Read more

if I create ‘front-page.php’, then how do I link to post index?

Since WordPress 4.5 you can use get_post_type_archive_link( ‘post’ ) to link to the page containing the blog posts. Depending on what you’ve set under Settings -> Reading, this will be either the front page, e.g. example.com/ or a specific page like example.com/news/. home_url( “https://wordpress.stackexchange.com/” ) always points to the front page.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)