Tag: WordPress Functions
-
add_action – WordPress function to hook on events
add_action is an extremely used WordPress function, constructed using of PHP’s native function call_user_func_array, widely used in WP core, plugin & theme. In other sense, add_action is similar method to JavaScript’s on event binding mechanism – on(‘event’)
-
Wp Ajax – WordPress Hook to Handle Ajax Request
Basic usage of wp_ajax and wp_ajax_nopriv on your WordPress. Add ajaxurl variable on any of your front pages.
-
Create or modify wordpress post type with register_post_type function
Register a custom post type with register_post_type on the init hook, with the arguments that matter – show_ui, show_in_rest, supports, rewrite and capabilities.
-
register_taxonomy – WordPress Function to Create or Modify Taxonomy
Create or modify a WordPress taxonomy with register_taxonomy – hierarchical, query_var, rewrite and show_in_rest arguments explained with a working example.
-
Strip out all Html, Php, Js tags by wp_strip_all_tags WordPress Function
What wp_strip_all_tags does beyond PHP strip_tags – it removes script and style contents too, and can collapse line breaks.