How do I permanently Disable Attachment Post URL

The form for the ‘From Url’ tab seems to be pretty much hard-coded, so I don’t think there is away of removing the ‘Link Image To’ field. However, for the Media Library tab you can remove the link field, with the following: add_filter(‘attachment_fields_to_edit’, ‘my_attachment_fields_edit’, 10, 2); function my_attachment_fields_edit($form_fields,$post){ //Set attachment link to none and hide … Read more

Custom Taxonomy Permalinks Redirection

What is the best way to allow http://www.domain.com/newtype/newtax-term/post-name/ to load, without redirecting? You have to add a custom rewrite rule to make this work. Otherwise WordPress doesn’t understand the newtax-term part of your permalink structure and redirects you to the URL which it does understand, which is %post_type%/%post_slug%. If you want to understand how WordPress … Read more

Short_title character problem

Use mb_strlen(), not strlen(). The same with mb_substr() and substr(): Your title contains multi-byte characters, but strlen() and substr() do not work on characters, they work on single bytes. For a improved function to shorten strings see this answer.

PHP Fatal error: Call to undefined function plugin_basename

plugin_basename is a WordPress function that gets your plugins file name by simply passing it the directory. When you call $this->plugin_basename PHP is looking for a function plugin_basename defined within YOUR class. No function plugin_basename() in your class == PHP Fatal Error. If you simply want to define a variable that contains the plugins file … Read more