Posted By : Date : fanuzzi | 04-03-2021
To edit the Admin header of your new post type page you need to add the following code: Hook add_action(‘admin_head-edit.php‘,’edit_change_title_function’); The edit function in your function you have to check if the post type is the one you need, and then apply a filter for the title function edit_change_title_function(){ global$post; if($post->post_type == 'posttype_name') { add_filter('the_title','posttype_title_function',100,2); } } So, you can override the title getting the value from db: function posttype_title_function($title, $post_id) { $new_title = get_post_meta($post_id,'slb_first_name',true) .' '.get_post_meta($post_id,'slb_last_name',true); return $new_title; }
Read More
0 Comments
Posted By : Date : fanuzzi | 04-03-2021
A custom fields are, basically, the properties for a post type. The creation phase of a custom field is divided in two parts: Creation of the structure Define the behavior Creation of the structure Add metabox Metabox is the graphic container of our custom fields. It will appear as a fieldsets in the admin page, containing our custom fields. add_action('add_meta_boxes_{post_type_name}','add_metabox_function');function add_metabox_function($post){  add_meta_box('id','title','metabox_field_function','post_type_name','normal','default');} This function will contain all necessary html, CSS and logical code to manage and show our custom fields. function metabox_field_function(){   //html code to show fields and php…
Read More
0 Comments
WordPress Custom Post Type
Posted By : Date : fanuzzi | 04-02-2021
Post types are a way to categorize different types of content in WordPress. Wordpress has already the following native post type: Post Pages Attachments Revisions Navigation menu custom CSS Changeset Most probably you just knew about the first three in the list. And you can extend these wordpress post type with your own. To do this you here it is a little function recap. Hook custom post type definition Hook add_action( 'init', 'custom_posttype_def', 0 ); custom post type definition function custom_posttype_def() { // Set UI labels for Custom Post Type…
Read More
0 Comments
Posted By : Date : fanuzzi | 04-02-2021
Here it is a little schema to recap the creation of a wp shortcode 1. Hook 2. Shortcode registration 3. Shortcode content 1. Hook add_action('init','callback_register_shortcode'); 2. Shortcode registration function callback_register_shortcode(){ add_shortcode('shortcode_name','sc_content_function');}   3. Shortcode content function sc_content_function($args, $content=""){   $output="<div> shortcode html content</div>";   echo $output;} But how we can submit data through shortcodes? Here it is. Hook you need to register two ajax function: add_action('wp_ajax_nopriv_{save_your_posttype_function}', 'save_your_posttype_function'); // regular website visitoradd_action('wp_ajax_{save_your_posttype_function}', 'save_your_posttype_function'); // admin user submit action The submit action inside your shortcode must be something like this: action="/wp-admin/admin-ajax.php?action=save_your_posttype_function" method="post"…
Read More
0 Comments
Posted By : Date : fanuzzi | 02-13-2021
If you are reading this post then, probably, you need to execute your java app as a Linux service. This can be done in 4 really easy steps Create the servicecreate a bash scriptgive execution permission to the bash fileenable and start your brand new service Step 1: create the system service sudo nano /etc/systemd/system/MyFantasticJavaApp.service it will open the nano editor. Add the following, changing the working directory and the User values based on your convenience [Unit] Description=good old Java application [Service] User=root # The configuration file application.properties should be…
Read More
0 Comments
Posted By : Date : fanuzzi | 10-22-2020
1) pinout This tool is provided by the GPIO Zero Python library,  It allows you to know better the GPIO map of your raspberry. So GPIO number, which are for 5v/3.3v and which are for negatives Installation Before we can use the pinout tool, we need to first update the package list by running the following command. sudo apt update Then, we can install the package that will provide us with the pinout tool by using the command below. sudo apt install python3-gpiozero and finally pinout 2) gpio readall Basically the library…
Read More
0 Comments
Posted By : Date : fanuzzi | 10-20-2020
Lately I started to work on a new environment and the first thing has been to install git. The second thing has been to clone a repository and finally I started to pull and push things. But! Every time I pulled and pushed something a very nasty little window started bothering me: insert username, insert password (because of course the repository was protected by a password) And if initially I endured it, after the third time I started to hate it. So...I decided to save locally my git username and…
Read More
0 Comments
Major.Minor.Patch
Posted By : Date : fanuzzi | 10-02-2019
Every time you release a public (API) software you must update his version number. The (public) version is universally composed by 3 numbers separated by a point: Each version number has a semantic representation The pattern is  Major.Minor.Patch Ex: in version number 10.2.5 10 is the Major version 2 is the Minor version 5 is the Patch version All of these 3 numbers are always  IncrementedNEVER decrementedPositive starting by 0 Patch number It is incremented each time the release is about fixing some bug without affecting the already existing public…
Read More
0 Comments
Posted By : Date : fanuzzi | 05-28-2019
right click --> Source --> generate toString() --> Generated code fieldset --> Edit button --> New.. button --> give a name (ex. JSON) --> copy and paste this pattern: {"${member.name()}":"${member.value}", "${otherMembers}"} That's it. Hope this help!
Read More
1 Comments
The Project Management Course: Beginner to PROject Manager
Posted By : Date : fanuzzi | 05-02-2019
Course to acquire the business acumen to: Manage a project on your ownUnderstand how to structure projects in large, medium, and small organizationsBecome a project managerGet promoted and apply what you learn here to the real business worldGain an all-around view of why some projects succeed and why others do not What I learned: Learn the fundamental theory and best practices of project managementPerform an entire project from the beginning until its end, observing real-life scenarios and using practical PM templates!Understand the project manager role and acquire the skills needed…
Read More
0 Comments
1 2 3 5