| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Fetch the admin menu slug for a snippets menu |
| 5 |
* |
| 6 |
* @deprecated Use code_snippets()->get_menu_slug() instead |
| 7 |
* |
| 8 |
* @param string $menu The menu to retrieve the slug for |
| 9 |
* |
| 10 |
* @return string The menu slug |
| 11 |
*/ |
| 12 |
function code_snippets_get_menu_slug( $menu = '' ) { |
| 13 |
return code_snippets()->get_menu_slug( $menu ); |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Fetch the URL to a snippets admin menu |
| 18 |
* |
| 19 |
* @deprecated Use code_snippets()->get_menu_url() instead |
| 20 |
* |
| 21 |
* @param string $menu The menu to retrieve the URL to |
| 22 |
* @param string $context The URL scheme to use |
| 23 |
* |
| 24 |
* @return string The menu URL |
| 25 |
*/ |
| 26 |
function code_snippets_get_menu_url( $menu = '', $context = 'self' ) { |
| 27 |
return code_snippets()->get_menu_url( $menu, $context ); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Fetch the admin menu hook for a snippets menu |
| 32 |
* |
| 33 |
* @deprecated Use code_snippets()->get_menu_hook() instead |
| 34 |
* |
| 35 |
* @param string $menu The menu to retrieve the hook for |
| 36 |
* |
| 37 |
* @return string The menu hook |
| 38 |
*/ |
| 39 |
function code_snippets_get_menu_hook( $menu = '' ) { |
| 40 |
return code_snippets()->get_menu_hook( $menu ); |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* Fetch the admin menu slug for a snippets menu |
| 45 |
* |
| 46 |
* @deprecated Use code_snippets()->get_snippet_edit_url() instead |
| 47 |
* |
| 48 |
* @param int $snippet_id The snippet |
| 49 |
* @param string $context The URL scheme to use |
| 50 |
* |
| 51 |
* @return string The URL to the edit snippet page for that snippet |
| 52 |
*/ |
| 53 |
function get_snippet_edit_url( $snippet_id, $context = 'self' ) { |
| 54 |
return code_snippets()->get_snippet_edit_url( $snippet_id, $context ); |
| 55 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* Get the required capability to perform a certain action on snippets. |
| 59 |
* Does not check if the user has this capability or not. |
| 60 |
* |
| 61 |
* If multisite, checks if *Enable Administration Menus: Snippets* is active |
| 62 |
* under the *Settings > Network Settings* network admin menu |
| 63 |
* |
| 64 |
* @deprecated Use code_snippets()->get_cap() instead |
| 65 |
* @since 2.0 |
| 66 |
* @return string The capability required to manage snippets |
| 67 |
*/ |
| 68 |
function get_snippets_cap() { |
| 69 |
return code_snippets()->get_cap(); |
| 70 |
} |
| 71 |
|
| 72 |
/** |
| 73 |
* Return the appropriate snippet table name |
| 74 |
* |
| 75 |
* @deprecated Use code_snippets()->db->get_table_name() instead |
| 76 |
* @since 2.0 |
| 77 |
* |
| 78 |
* @param string|bool|null $multisite Retrieve the multisite table name or the site table name? |
| 79 |
* |
| 80 |
* @return string The snippet table name |
| 81 |
*/ |
| 82 |
function get_snippets_table_name( $multisite = null ) { |
| 83 |
return code_snippets()->db->get_table_name( $multisite ); |
| 84 |
} |
| 85 |
|