PluginProbe
Code Snippets / 2.12.0
Code Snippets v2.12.0
3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 3.0.1 All 64 releases
code-snippets / php / functions.php

functions.php in Code Snippets 2.12.0, at php/functions.php

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