Download the PHP package kayue/kayue-wordpress-bundle without Composer
On this page you can find all versions of the php package kayue/kayue-wordpress-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kayue/kayue-wordpress-bundle
More information about kayue/kayue-wordpress-bundle
Files in kayue/kayue-wordpress-bundle
Package kayue-wordpress-bundle
Short Description Support for authenticating WordPress users in Symfony2.
License MIT
Homepage http://github.com/kayue/KayueWordpressBundle
Informations about the package kayue-wordpress-bundle
KayueWordpressBundle
Improved version of the original WordpressBundle. The biggest different is this new KayueWordpressBundle won't load the entire WordPress core, thus all the WordPress template funtions won't be available in your Symfony app. This is also the goal of the bundle; do everything in Symfony's way.
I started that bundle two years ago and the original repository grew somewhat chaotically, so I decided to start fresh with new repositories.
Features
- WordPress authentication (v1.0.0)
- Custom table prefix (v1.0.1)
- WordPress entities (v1.0.2)
- Multisite support (v1.1.0)
- Twig extension (v1.1.0)
- WordPress style shortcode (v1.1.0)
- Major code update. (v2.0.0)
- Support Symfony 4, new cache configuration (v4.0.0)
Todo
- Unit test (please help!)
Installation
Composer
Register the bundle
Configuration
Doctrine
This bundle requrie database connection. Make sure you have Doctrine configurated properly.
config.yml
The following configuration is optional.
Usage
An example to obtain post content, author, comments and categories:
Twig Extension
This bundle comes with the following Twig extensions.
Functions
wp_switch_blog
- equivalent to WordPress'sswitch_to_blog()
method.wp_find_option_by
- equivalent to WordPress'sget_option()
method.wp_find_post_by
- Get post by ID or slug.wp_find_post_metas_by($post, $key)
- equivalent to WordPress'sget_post_meta()
method.wp_find_post_metas_by({'post': $post, 'key': $key})
- Same as above, accept array as argument.wp_find_comments_by_post($post)
- return all approved comments in a post.wp_find_attachments_by_post($post)
wp_find_attachment_by_id($id)
wp_find_thumbnail($post)
- alias ofwp_find_featured_image_by_post
wp_find_featured_image
- equivalent to WordPress'sget_the_post_thumbnail
method.wp_get_attachment_url($post)
wp_get_post_format
wp_find_terms_by_post
wp_find_categories_by_post
- equivalent to WordPress'sget_categories()
method.wp_find_tags_by_post
- equivalent to WordPress'sget_tags()
method.
Filters
wp_autop
- Wrap paragraph with<p>
tag. Needed for post formatting.wp_texturize
- Texturize. Needed for post formattingwp_shortcode
- equivalent to WordPress'sdo_shortcode()
method.
To transform extra content like video links or social network links, you can use the Essence Bundle
Multisite
Multisite is a feature of WordPress that allows multiple virtual sites to share a single WordPress installation. In this bundle, each blog (site) has its own entity manager. You need to use blog manager to retrive the blog and then the entity manager.
The following example shows you how to display the latest 10 posts in blog 2.
WordPress Authentication
This bundle allow you to create a WordPress login form in Symfony. All you have to do is to configure the WordPress firewall in your security.yml
.
The following example demonstrates how to turn AcmeDemoBundle's login form into a WordPress login form.
Shortcode
WordpressBundle support WordPress style shortcode. At the moment the bundle only come with the [caption]
and [gallery]
shortcode.
Pull request is welcome.
To create new shortcode, you need to
- extends
ShortcodeInterface
- tag it with
kayue_wordpress.shortcode