mbis

Permalink Manager - ACF Extended Pro

Apr 22nd, 2021 (edited)
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. function pm_generate_uri_after_post_saved($post_id, $type, $args, $form, $action) {
  2.     if(class_exists('Permalink_Manager_URI_Functions') && $type == 'insert_post') {
  3.         $custom_uri = Permalink_Manager_URI_Functions_Post::get_default_post_uri($post_id, false, true);
  4.         Permalink_Manager_URI_Functions::save_single_uri($post_id, $custom_uri, false, true);
  5.     }
  6. }
  7. add_action('acfe/form/submit/post', 'pm_generate_uri_after_post_saved', 9, 5);
  8.  
  9. function pm_generate_uri_after_term_saved($term_id, $type, $args, $form, $action) {
  10.     if(class_exists('Permalink_Manager_URI_Functions') && $type == 'insert_term') {
  11.         $custom_uri = Permalink_Manager_URI_Functions_Tax::get_default_term_uri($term_id, false, true);
  12.         Permalink_Manager_URI_Functions::save_single_uri($term_id, $custom_uri, true, true);
  13.     }
  14. }
  15. add_action('acfe/form/submit/term', 'pm_generate_uri_after_term_saved', 9, 5);
Add Comment
Please, Sign In to add comment