Using GitHub After Enabling Two-Factor Authentication

Generate GitHub access token

If you've activated Two-Factor authentication for your GitHub account, you will discover your GitHub account password will become obsolete when performing Git operations that requires account authentication (such as push, fetch, pull) using HTTPS.A personal access token instead of an account password is what is required to interact with GitHub via https.Creating a GitHub Personal Access Token Firstly, log in to your GitHub account, … [Continue reading]

Import WordPress Plugins From the SVN Repository to GitHub Properly

Importing in progress

Few days ago, I created a free version of my premium plugin ProfilePress and open sourced it on GitHub.Prior to putting it on GitHub, it has been in a private Bitbucket repository where all code changes and deployment to WordPress plugin subversion (SVN) repository are carried out.In this article, I will show us how I imported the plugin hosted in a plugin SVN repo. to GitHub with all the tags and commit history preserved.First off, … [Continue reading]

How to Remove and Create Hidden WordPress Admin Pages

WordPress Admin Menu

WordPress provides add_menu_page() and add_submenu_page() for creating top-level menu and sub menu admin pages. Settings pages created with these functions usually appear in the admin menu.In this tutorial, we will learn how to remove admin pages / items from the admin menu and still be able to them directly via their page URL.Removing Top Level Menu Pages To remove top-level pages item in amin menu, use remove_menu_page() as … [Continue reading]

Query WordPress Posts in a Custom Post Type and Custom Taxonomy

WordPress WP_Query

Here is a quick tip on querying posts that belongs to a custom post type and category / custom taxonomy.Actually, I ran into this problem while working with Easy Digital Downloads plugin.I wanted to query a list of products in a given category. I thought the query will be easy to construct but I was wrong.Note: all EDD products are actually posts of a download custom post type and the category, a custom taxonomy with name … [Continue reading]

How to Download a Given Folder in a Github Repository via SVN

SVN export completed.

There are times we download or clone a full GitHub repository when all that is needed is a given folder in it.Say (like me) you use PHP Code Sniffer Tool to analyze and detect violations of a defined coding standard in PHP code and you've decided to include PSR2 standard to your list of installed standards.Instead of the old way of cloning or downloading the whole repository, i will show you how to download just the PSR2 folder via Apache … [Continue reading]

Adding Custom Admin Notices & Error alert in WordPress

Custom WordPress Admin Notices

When developing plugins for WordPress, I seldom use the Settings API to build the plugin settings page instead, I build it from ground-up utilizing the Options API to store the plugin data to the database.Not quite long, I discovered I could use the function add_settings_error() — a member of the Settings API family — to output custom admin notices/messages to users about settings validation problems, missing settings and even success … [Continue reading]

Set Default Editor Mode (TinyMCE / HTML) in WordPress

WordPress TinyMCE Editor

I recently built a plugin where I needed WordPress to by default always set its editor to Text (HTML) mode and not tinyMCE.This is achievable using the undocumented filer wp_default_editor.To make TinyMCE always display by default, use the code below.[php] function set_default_editor() { $r = 'tinymce'; return $r; } add_filter( 'wp_default_editor', 'set_default_editor' ); [/php]To make the text / HTML mode the default … [Continue reading]

Vagrant Fix: `parse': (<unknown>): found a tab character that violate intendation while scanning a plain scalar

Laravel homestead vagrant error

In case you haven't heard, I have move my PHP development from XAMPP to Vagrant, Laravel homestead box to be precise. A post on getting started with vagrant coming soon.As always whilst starting a new project, i added the site to Homestead.yaml, did Vagrant up and got the following error messages.c:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): found a tab character that violate intendation while … [Continue reading]