Tag: development

  • WordPress Options Passed To JavaScript #2

    In our first article of this mini series, I explained how to pass with JSON from PHP to JS. Alternativly you can do this with the WordPress function wp_localize_script(), but contains some pitfalls. Therefore this little tutorial, also you should think about it in advance about these two solutions.

  • 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…

  • 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…

  • Load Minimum of WordPress

    A small contribution for all those using WordPress as a backend, framework or something similar. The applications, especially in the B2B sector, becoming more and more, as do the questions. So far, I’ve always liked to recommended BackPress. But even a well-maintained standard is feasible, with all its advantages in the context of the philosophy…

  • Don’t use strlen()

    Don’t use strlen()

    Each time I see someone use strlen() I cringe. It will break. Despite its name, strlen() doesn’t count characters. It counts bytes. In UTF-8 a character may be up to four bytes long. So what happens if we use strlen() and its companion substr() to shorten the title of post? <?php # -*- coding: utf-8…

  • WP_List_Table – a step by step guide

    WP_List_Table – a step by step guide

    Throughout WordPress the class WP_List_Table is used to display data, e.g. users, plugins, comments, or posts. The class contains almost all necessary methods for displaying, sorting, paginating, and searching data and and what is more obvious than to use it for your own plugins? This article tries to give you a comprehensive walk-through all necessary…