How can I call functions from a custom plugin?

You don’t, alert is a javascript function that runs in the browser. PHP runs on the server, the two are different languages that run in different places. Instead, consider using script tags: return ‘<script>window.alert(“Connected to the database successfully.”)</script>’;` console.log(“”) may be a more appropriate method than alert(“”) for debugging I would also note, that shortcodes … Read more

Create Shortcode shows only posts with custom_field meta

You need your shortcode to accept attributes. A shortcode with attributes would look like: [publication year=”2017″] Then in your add_shortcode callback function you receive attributes in the first parameter of the function: function wpse_279094_publication_shortcode( $atts ) { echo $atts[‘year’]; } add_shortcode( ‘publication’, ‘wpse_279094_shortcode’ ); You want to be able to account for a user not … Read more

Change Order of Sections Using Custom Fields

Have 5 custom fields: the first 4 are your sections and the last would be your order identifier. CASE 1 If you want to have the order simply revsered have the last field be a dropdown with “normal” or “reversed”. (You could even say “random”… the world is your oyster) $s1 = ‘<section id=”1″>$customfield1</section>’; $s2 … Read more

Ajax Category add doesn’t update the list table custom column

The code is fully functional and tested. Add this in functions.php and check. I am giving you an example using the checkbox in the add and edit for the category. function mytheme_custom_column( $columns ) { $columns[‘my_column’] = ‘My custom column’; return $columns; } add_filter( ‘manage_edit-category_columns’ , ‘mytheme_custom_column’ ); function mytheme_custom_column_fill( $content, $column_name, $term_id ) { … Read more