PluginProbe
Code Snippets / 2.12.1
Code Snippets v2.12.1
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.1, at php/functions.php

85 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 *
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