Wordpress custom admin table from database with pagination Categories: Code PHP Web development CMS Wordpress Tags: Wordpress Code plugin Objective Create a custom table with data from a database sql query, with sort and pagination, in WordPress admin panel. Step 1: create a custom menu link to access a new page for the table Step 2: create callback function for the menu link, prepare data input for pagination, sort and print form + table Note: this should be improved to use full WordPress advantages of wp_list_table Step 1: create a custom menu link to access a new page for the table Read more about Wordpress custom admin table from database with pagination
Wordpress add link to admin menu bar Categories: Code PHP Web development CMS Wordpress Tags: Wordpress Code plugin admin Step 1: call add_action 'admin_menu' Step 2: create custom function for the new link Step 1: call add_action 'admin_menu' add_action( 'admin_menu', 'register_example_custom_menu_link_menu_page' ); Read more about Wordpress add link to admin menu bar
Wordpress disable admin bar for all users except for administrators Categories: Code PHP Web development CMS Wordpress Tags: Wordpress Code plugin /** * Disable Admin Bar for All Users Except for Administrators */ function remove_admin_bar() { Read more about Wordpress disable admin bar for all users except for administrators
Wordpress get user role from plugin Categories: Code PHP Web development CMS Wordpress Tags: Wordpress Code plugin Method 1: by global $current_user for the current user logged in Method 2: check if an user has a specific role by SQL query Method 1: by global $current_user for the current user logged in /** * Checks if current user has administrator role * @return boolean */ Read more about Wordpress get user role from plugin
Wordpress shortcode example Categories: Code PHP Web development CMS Wordpress Tags: Wordpress Code shortcode plugin Step 1: make your own function inside your plugin Step 2: call add_shortcode inside your plugin Step 3: use the shortcode in a text widget Step 1: make your own function inside your plugin /** * shortcode: site url * @return string */ Read more about Wordpress shortcode example
Wordpress make your own plugin multilingual Categories: Code PHP Web development CMS Wordpress Tags: Wordpress plugin Code multilingual Summary Step 1: make some string in your plugin translatable Step 2: load the function with add_action 'init' in your plugin Step 3: create folder and file for translations inside your plugin Step 4: update your language files with poedit In the example, we are going to translate the plugin to Spanish. Read more about Wordpress make your own plugin multilingual
Javascript collapse div with JQuery and Bootstrap Categories: Code Javascript Web development Tags: Javascript JQuery Bootstrap Ejemplos Notas Collapse only one div HTML <!-- user should click here --> Read more about Javascript collapse div with JQuery and Bootstrap
Javascript upload files with AJAX Categories: Code Javascript Web development Tags: Javascript JQuery upload PHP The objective is to save form data with file inputs and AJAX. Step 1: process files before the rest of data, save them to disk and database. Step 2: process the rest of field inputs, validate and the save them all. HTML <div id="wrapper"> Read more about Javascript upload files with AJAX
Javascript html file input with an image Categories: Code Javascript Web development Tags: Javascript HTML Javacript function getFile() { Read more about Javascript html file input with an image
Javascript JQuery find element by data attribute Categories: Code Javascript Web development Software Tags: Javascript JQuery data-attribute Code HTML <div class="form-group "> Read more about Javascript JQuery find element by data attribute