You can totally use namespaces in your project/theme/plugin!
The only drawback is that you introduce a PHP 5.3 dependency, while WordPress itself only requires 5.2.4.
I guess in 2015 this is not a big issue, even when distributing a plugin to a wide community (opensource or envato).
Roots team is using namespaces in their themes, plugins, etc: https://github.com/roots/sage
Related Posts:
- Nonce in settings API with tabbed navigation
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- WordPress mode for emacs?
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- $_POST form request with admin-post
- How can I configure Docker for developing and deploying a custom theme?
- Add screen options to custom admin pages
- How can I run AJAX on a button click event?
- Completely remove WP_Admin_Bar for specific user roles
- WordPress and PHP Sessions – Security and Performance
- WordPress Hook for user register
- What is the difference between using global $current_screen and get_current_screen()?
- How to make repeated component/block in Gutenberg
- Must-use plugins autoloader: How to use get_plugins() correctly?
- Changing upload directory for plugin uploads only
- Upload file to remote storage
- How Do I Make WordPress Run an Event Every Day?
- How can I change the frequency of a scheduled event?
- How to filter $post->post_content prior to save
- How to get data from WordPress $wpdb into React Gutenberg Blocks Frontend?
- How to check if certain plugin exists and in expected version
- Why won’t register_setting() create a setting?
- One time username change from frontend?
- Customizer Not Saving Options
- How to add SQL file with PHP to WordPress database [closed]
- How to extend a plugin like we do a theme?
- How to add custom text in wordpress logs
- Rewrite url for existing page without flush_rewrite_rules
- Front-End Interfaces Without Shortcodes
- Is there a way to loop through a shortcode datasource to create a table?
- Execute plugin for specific user role(s) only
- How can I call template partials inside my custom plugin
- WordPress REST API, run long background job
- Make a list with header and subtext in Gutenberg blocks
- Plugin development: How many plugin and WordPress version combinations to support?
- Hook to get image filename when it is uploaded
- Clearing cached plugin data if it is using an external object cache
- WordPress not working on localhost
- manage_posts_custom_column, showing serial number using increment in loop
- Custom delete option button in plugin settings
- wp_scheduled_event being removed mysteriously
- Sub Menu content is being duplicated
- how to append custom metabox field with the ACF custom fields id in wordpress development
- $_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}
- Memberpress Hooks and Activity
- Storing data in wordpress database from ajax call from different website
- Prevent invalid or empty values from being saved to the database and retain the form field values upon error
- Hide shortcodes “code” when using the “editor” the same as wordpress do with “gallery”
- Adding fields to category manager. Does a method exist to get the link to the category edit screen?
- How to test a WordPress plugin in real time
- Distributing Frontend Assets with Plugins
- Wp-admin Custom User Management
- Can we intercept user_login and user_pass from a wp_login_form?
- Hook add_attachment error
- Undefined variable’s error when expected to have passed the content of variable [closed]
- How do I find the page/url where a search came from when using pre_get_posts filter?
- Shortcode conflicts
- How can I add rewrite rules to a class-based plugin?
- hook update_option/updated_option empty $old_value and $value
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- How to add a panel/box/widget/are/screen to the right side of edit post/page confusion
- How to output functions from plugin inside theme
- Sharing Variables between scheduled events
- Issue with plugin sub menu and pages
- How can I programmatically change a MySql variable (foreign_keys_check)?
- Using delete_post_meta for deleting multiple selected options
- Workflow for new importer plugin – your advices?
- Should I put my plugin javascript inline?
- Get Posts by IDs (optionally)
- Can / should a widget plugin define its own Widget Area?
- How to automatically activate a plugin on install
- disable defaault wordpress comments from a plugin
- Why doesn’t my Table get created?
- How to get the `comment_post_ID`?
- Can someone explain what’s the use of parse request function in WordPress?
- Add parameters to 3rd party callback function
- add_editor_style to the blog editor view (Gutenberg?)
- How does update method in Widget class saves $instance array from Select tag?
- jQueryUI draggable doesn’t work in WordPress plugin
- call funcution when clicking submit
- WooCommerce – Stop assigning order numbers
- How can I pass WP_Query results to a plugin?
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- How to prevent users from deleting their accounts?
- How do I get a reference to the HTML memory buffer while the page is being constructed?
- WC_Geolocation not found inside plugin
- Set widget icon in Customizer?
- How to customize the size of Featured Images or Post Thumbnails in WordPress?
- add_option_{$option} action hook not being called
- Remove all capabilities in separate method fails versus included in method
- Hook for plugin to show content for certain urls
- Why does unzip_file always return true but nothing happens?
- Let user override plugin CSS
- What happens when you create/edit a menu
- Add_menu_page and saving settings
- Updating Style From WP Options Setting Page
- add short code not working
- What method would I use to show an image in between X amount of posts on category archive? [duplicate]
- Shortcode attribute “title” doesn’t appear in $atts array
- Plugin – Proper way to handle 404 pages?