Change content of WordPress Editor Buttons

Not every user likes the default settings how some buttons are displayed on the WordPress editor. As of right now, there is no possibility to adjust it directly via a filter. The following source code describes a solution to change the link buttons and their content to easily set links with custom values. The small Plugin changes the values with the help of Javascript and returns a popup for set links with custom values inside the Plugin.

Continue reading …

Hide Welcome Panel for WordPress Multisite

With a major release update of WordPress, everytime all new functions will be displayed after updating. Basically a good idea, which displays all new features on one page. However, this is not always intentional. In the corporate environment, large groups of users aren't interested in it, so that this screen only provides additional work for the support team.
WordPress has implemented an option for every user. Therefore, a small function that suppresses the info screen and adjust the user settings, so this screen won't appear.

Continue reading …

WordPress Options Passed To JavaScript #1

In WordPress you are not always in the PHP world and so you have to pass settings and data from the database to scripts sometimes. In many Plugins you can find solutions in loading the wp-load.php and therefore access to all features of WordPress. Long ago Otto (Samuel Wood) already referred to this fact and this articles shows solutions. Questions still there and still there are Plugins that load the wp-load.php precisely because of such problems.

A similar problem arises when the source of the scripts is not just written in the footer area of WordPress, but outsourced to a file and via wp_enqueue_script() included. Only then WordPress can manage, compromises and optimizes these scripts for delivery. Therefore I would like to show two examples, how to pass data from PHP to JS.
Continue reading …

First or Last Page in Page-Structures of WordPress

Now and then little snippets are pretty useful. For a fix in a Premium-Theme, I needed a kind of evaluation, where I am in the site structure and with little effort I was able to expand the classes and react with CSS.

The following code shows the basic for it and get_pages() is the key from the core of WordPress to get to these results. This function provides the necessary result of using the parameter and the output via the parameter sort_order provides the sequence and identification of the first page, which is then either the first or last page in this structure.
Continue reading …