Title: NeoCrash's Replies | WordPress.org

---

# NeoCrash

  [  ](https://wordpress.org/support/users/neocrash/)

 *   [Profile](https://wordpress.org/support/users/neocrash/)
 *   [Topics Started](https://wordpress.org/support/users/neocrash/topics/)
 *   [Replies Created](https://wordpress.org/support/users/neocrash/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/neocrash/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/neocrash/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/neocrash/engagements/)
 *   [Favorites](https://wordpress.org/support/users/neocrash/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Custom Fields: Extended] passing arguments to the validation](https://wordpress.org/support/topic/passing-arguments-to-the-validation/)
 *  Thread Starter [NeoCrash](https://wordpress.org/support/users/neocrash/)
 * (@neocrash)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/passing-arguments-to-the-validation/#post-15061139)
 * Awesome, all understood.
 * Is true about always returning a value in a function, is coding 101, hehe I missed
   that.
 * I´ll modify the argument, as you suggested, so the $form[‘post_id’] is as default,
   to avoid issues.
 * Thank you so much
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Custom Fields: Extended] passing arguments to the validation](https://wordpress.org/support/topic/passing-arguments-to-the-validation/)
 *  Thread Starter [NeoCrash](https://wordpress.org/support/users/neocrash/)
 * (@neocrash)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/passing-arguments-to-the-validation/#post-15057519)
 * Solution founded while sleeping, I’m sure you all have these epiphanies while
   sleeping 🙂
 * I just need to pass the post_id using a form argument.
    I defined the form argument
   while loading the form
 *     ```
       add_filter('acfe/form/load/form=prop_edit', 'my_form_settings', 10, 2);
       function my_form_settings($form, $post_id){
   
           // Add currently eddited post_ID got it from the URL parameter
           $form['post_id'] = $_GET['art'];
   
           return $form;
   
       }
       ```
   
 * Finally, I can use this form argument, during validation, to access to the edited
   post ID.
 *     ```
       add_action('acfe/form/validation/form=prop_edit', 'valida_edicion', 10, 2);
       function valida_edicion($form, $post_id){
            $id_actualizar = $form['post_id'];
   
           //Note that $post_id argument only returns the post ID of the page where the form is rendered, not the post_id of the edited post (read original support request post).
          //I call the function that validates if the user is administrator, editor or is the author of the currently edited post. It needs the post_id.
   
          if (!permiso_modificar($id_actualizar)){
                acfe_add_validation_error('prop_estado', 'No tienes permiso para modificar esta propiedad. Si considera que a ocurrido un error, contacte soporte técnico.');
            }
       }
       ```
   
 * Left here the whole history for the next users.
    -  This reply was modified 4 years, 8 months ago by [NeoCrash](https://wordpress.org/support/users/neocrash/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AddToAny Share Buttons] Shows on every peepso page](https://wordpress.org/support/topic/shows-on-every-peepso-page/)
 *  [NeoCrash](https://wordpress.org/support/users/neocrash/)
 * (@neocrash)
 * [7 years ago](https://wordpress.org/support/topic/shows-on-every-peepso-page/#post-11683379)
 * This also happens to me. The icons are shown at the bottom of every peepso page
   even if this is all options are deactivated.
    Any idea why? and more importantly
   how to fix it?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Code Snippets] Execute snippets: User roles / loaded admin pages as criteria](https://wordpress.org/support/topic/execute-snippets-user-roles-loaded-admin-pages-as-criteria/)
 *  [NeoCrash](https://wordpress.org/support/users/neocrash/)
 * (@neocrash)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/execute-snippets-user-roles-loaded-admin-pages-as-criteria/#post-11239139)
 * I guess you can use something like
    if (!current_user_can(‘administrator’) &&!
   is_admin()) { /*place your code here for no admin users*/ }

Viewing 4 replies - 1 through 4 (of 4 total)