Skip to content

Instantly share code, notes, and snippets.

@kylephillips
Last active January 26, 2022 21:41
Show Gist options
  • Save kylephillips/f2b94dc9b61470c6216b780291f89e39 to your computer and use it in GitHub Desktop.
Save kylephillips/f2b94dc9b61470c6216b780291f89e39 to your computer and use it in GitHub Desktop.
<?php
add_filter('nestedpages_row_parent_css_classes', 'nestedpages_filter_row_css_classes', 10, 3);
/**
* Filter the <li> element css classes for nested pages rows
* @param str - $row_classes - the CSS classes for output
* @param obj - $post - the current post object
* @param obj - $post_type_object - the current post type object
*/
function nestedpages_filter_row_css_classes($row_classes, $post, $post_type_object)
{
// Do any necessary logic here for adding the row class
// This particular class disables nesting
$row_classes .= ' mjs-nestedSortable-no-nesting';
return $row_classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment