Wordpress custom admin table from database with pagination Categorías: Código PHP Desarrollo web CMS Wordpress Etiquetas: 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 Leer más sobre Wordpress custom admin table from database with pagination
Wordpress add link to admin menu bar Categorías: Código PHP Desarrollo web CMS Wordpress Etiquetas: 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' ); Leer más sobre Wordpress add link to admin menu bar
Wordpress disable admin bar for all users except for administrators Categorías: Código PHP Desarrollo web CMS Wordpress Etiquetas: Wordpress Code plugin /** * Disable Admin Bar for All Users Except for Administrators */ function remove_admin_bar() { Leer más sobre Wordpress disable admin bar for all users except for administrators
Wordpress get user role from plugin Categorías: Código PHP Desarrollo web CMS Wordpress Etiquetas: 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 */ Leer más sobre Wordpress get user role from plugin
Wordpress shortcode example Categorías: Código PHP Desarrollo web CMS Wordpress Etiquetas: 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 */ Leer más sobre Wordpress shortcode example
Javascript collapse div with JQuery and Bootstrap Categorías: Código Javascript Desarrollo web Etiquetas: Javascript JQuery Bootstrap Ejemplos Notas Collapse only one div HTML <!-- user should click here --> Leer más sobre Javascript collapse div with JQuery and Bootstrap
Wordpress make your own plugin multilingual Categorías: Código PHP Desarrollo web CMS Wordpress Etiquetas: 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. Leer más sobre Wordpress make your own plugin multilingual
Javascript upload files with AJAX Categorías: Código Javascript Desarrollo web Etiquetas: 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"> Leer más sobre Javascript upload files with AJAX
Javascript html file input with an image Categorías: Código Javascript Desarrollo web Etiquetas: Javascript HTML Javacript function getFile() { Leer más sobre Javascript html file input with an image
Javascript JQuery find element by data attribute Categorías: Código Javascript Desarrollo web Software Etiquetas: Javascript JQuery data-attribute Code HTML <div class="form-group "> Leer más sobre Javascript JQuery find element by data attribute