|
@@ 1891-1895 (lines=5) @@
|
| 1888 |
|
public function filter_course_selected_terms( $terms, $course_ids_array, $taxonomies ){ |
| 1889 |
|
|
| 1890 |
|
//dont limit for admins and other taxonomies. This should also only apply to admin |
| 1891 |
|
if( current_user_can( 'manage_options' ) || ! is_admin() || empty( $terms ) |
| 1892 |
|
// only apply this to module only taxonomy queries so 1 taxonomy only: |
| 1893 |
|
|| count( $taxonomies ) > 1 || !in_array( 'module', $taxonomies ) ){ |
| 1894 |
|
return $terms; |
| 1895 |
|
} |
| 1896 |
|
|
| 1897 |
|
$term_objects = $this->filter_terms_by_owner( $terms, get_current_user_id() ); |
| 1898 |
|
|
|
@@ 1960-1962 (lines=3) @@
|
| 1957 |
|
{ |
| 1958 |
|
|
| 1959 |
|
// only for admin users ont he module taxonomy |
| 1960 |
|
if ( empty( $terms ) || !current_user_can('manage_options') || !in_array('module', $taxonomies) || !is_admin()) { |
| 1961 |
|
return $terms; |
| 1962 |
|
} |
| 1963 |
|
|
| 1964 |
|
// in certain cases the array is passed in as reference to the parent term_id => parent_id |
| 1965 |
|
// simply return this as wp doesn't need an array of stdObject Term |