Hot answers tagged

7

The dialog HTML comes from WP_Editors::wp_link_dialog() but no hooks in there. We could instead use jQuery to append the custom HTML to the link dialog and try to override e.g. the wpLink.getAttrs(), because it's very short ;-) Demo example: jQuery( document ).ready( function( $ ) { $('#link-options').append( '<div> <...


5

This question is really too localized to get a solid answer and will most likely get closed. Here's a quick guide to narrow down what the issue is - but the fact that I can click the links just fine and you can't makes it sound like an issue with your system and not necessarily WordPress: Site Broken? / \ Nope ...


4

Assuming you're using wp_nav_menu() to display your navigation you could apply a walker that looks for css classes: $items_wrap = '<nav class="...">'; $items_wrap .= '<ul id="%1$s" class="%2$s">%3$s</ul>'; $items_wrap .= '</nav>'; wp_nav_menu( array( 'container' => false, 'container_class' => false, '...


3

There is not ethical way of doing this. But still there is a way to do this. WordPress wrote wpLink script keeping in mind that editor is there but still WordPress handle when editor is not there (Good Thing) Consider this example and assume that we are using it on front-end in footer. First enqueue the essential style and scripts. function ...


3

We could hook into the after_wp_tiny_mce with some CSS to hide it, if the wplink editor plugin is loaded. Example: add_action( 'after_wp_tiny_mce', function( $settings ) { // Check for the 'wplink' editor plugin if( isset( $settings['content']['plugins'] ) && false !== strpos( $settings['content']['plugins'], 'wplink' ) ) ...


2

Add this function in your theme's functions.php function my_enqueue($hook) { if ('post.php' != $hook ) { return; } wp_enqueue_script('my_custom_script', get_template_directory_uri() . '/js/myscript.js'); } add_action('admin_enqueue_scripts', 'my_enqueue');` In myscript.js place this code jQuery(document).ready(function(){ jQuery('#...


2

Looking at the core, there's no trace of any filter or action in the wp_link_dialog function, which would have made your life easier... Investigating how others has solved this problem, there's a plugin that does more or less the same as you want. Basically it deregisters the wplink.js, wp_deregister_script('wplink'); and registers again a modified version ...


2

Turns out you are not the only one: https://core.trac.wordpress.org/ticket/32095 It looks like this was removed in a recent update (4.2) and I can see why they did it. User interface can be confusing at times. You can read more about the removal here: http://wptavern.com/how-to-restore-the-link-title-attribute-removed-in-wordpress-4-2 There is a ...


2

Assuming you are reading this answer in the future (December 2015 or later). Starting from WordPress 4.4.0, The $class argument was added. So: edit_post_link( __('Edit'), '', '', 0, 'post-edit-link btn btn-default' ); See edit_post_link documentation.


2

I have found the answers after spending some hours on it. Well i found that there was .htaccess file inside wpuploads folder with code. order deny,allow deny from all I deleted it and hence all is working now.


2

Place this code in your functions.php file add_action( 'admin_print_scripts-post.php', 'wpse22643_overwrite_wplinks' ); add_action( 'admin_print_scripts-post-new.php', 'wpse22643_overwrite_wplinks' ); function wpse22643_overwrite_wplinks( $hook ) { // register is important, that other plugins will change or deactivate this wp_register_script( ...


1

If the links are coming from the main content areas, you could create a hook which acts against this "content" output. In your themes functions.php file, you could try something like: add_filter('the_content', 'the_url_filter_function_name', 30); function the_url_filter_function_name($content) { return str_replace('bad-url.com', 'good-url.com', $...


1

This is some specific shortcode to some plugin, that if you just want to paste an image in wordpress editor isn't necessary. (Also there is not enough info about what this shortcode is about). So there is simple HTML that will simply display link you want as an image, following: <img src="http://here-goes-some-url-of-your-image" /> Make sure you ...


1

Settings --> Permalinks. Choose 'post name'. See the official Wordpress codex page for more.


1

Using JS is not really the best possible solution as it can be disabled on client side. You can also use PHP like regular expressions and DOM to alter the links, but I really think the most reliable way to achive this is to rebuild the list throught the term_link-post_tag filter which is located inside the get_the_term_list() function which is used by ...


1

What you are doing isn't ever going to work the way you want. the_terms() is going to produce a list of complete a tags so you can't nest or merge it with another one like you are trying to do. And there are no convenient arguments or filters that would allow you to alter that link text. There are some not-so-convenient ones though. The simplest is a filter ...


1

You need to create the hierarchy using page parents. Either use quick edit, or go through each page and set it's parent, so that you end up with: Menu1Submenu1 (Menu1 is parent)Item1 (Submenu1 is parent)


1

It's due to AAM (Advanced Access Manager) plugin. You have different options to fix the issue. 1) Disable AAM Media Manager plugin 2) You can changes AAM Media Manager plugin version 3) If you do not want AAM to handle your website images, Go to the following file /advanced-access-manager/extension/AAM_Media_Manager/extension.php and find private $_skip = ...


1

Within each menu item, object_id holds the ID of whatever object the menu item refers to. This will be a post / page / CPT / term ID. If it's a custom link, the ID refers to itself. (If you want to know what type of object it is, object contains that.) get_queried_object_id() will give you the ID of the current page. We can use the API function ...


1

First of all, you are using $rinter as a number and at the same time as an URL for the anchor element. Secondly, the href attribute requires mentioning the protocol (http(s):// for example) in front of the domain or else it will just be relative to the current viewing address. ($rinter should be something like http://www.w3.org instead of just www.w3.org)


1

You could use this search and replace tool: search and replace by interconnectit Apart from that you could put some redirects in your htaccess, but really the search and replace works great.


1

When adding an external link you need to include HTTP:// or HTTPS:// at the start of the URL to link to an external domain. Otherwise the link will be added onto the current domain.


1

After having the same issue, I've come up with a basic solution - hopefully it's not too late for you. The Visual Composer "accordion plugin" seems to be a wrapper around the jQuery UI accordion; so the same methods are available. I've written some basic (room for improvement no doubt) code that checks if there is a hash on the end of the URL, and then ...



Only top voted, non community-wiki answers of a minimum length are eligible