Created
November 22, 2019 18:07
-
-
Save 465media/7e40adf2cf25ce395e11ccb4835d4a06 to your computer and use it in GitHub Desktop.
Remove Oxygen post from Insert/edit link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function removeCustomPostTypesFromTinyMCELinkBuilder($query){ | |
| $key = false; | |
| $cpt_to_remove = array( | |
| 'oxy_user_library', | |
| 'ct_template' | |
| ); | |
| foreach ($cpt_to_remove as $custom_post_type) { | |
| $key = array_search($custom_post_type, $query['post_type']); | |
| if($key){ | |
| unset($query['post_type'][$key]); | |
| } | |
| } | |
| return $query; | |
| } | |
| add_filter( 'wp_link_query_args', 'removeCustomPostTypesFromTinyMCELinkBuilder' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment