Skip to content

Commit ee26b43

Browse files
author
symfony-flex-server[bot]
authored
Merge pull request #423
2 parents e89ee45 + 83d08cb commit ee26b43

File tree

14 files changed

+242
-0
lines changed

14 files changed

+242
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mukadi_wordpress:
2+
table_prefix: "%env(WP_PREFIX)%"
3+
wordpress_directory: '%kernel.project_dir%/public/%env(WP_DIR)%'
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"bundles": {
3+
"Mukadi\\WordpressBundle\\MukadiWordpressBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"config/": "%CONFIG_DIR%/",
7+
"public/": "%PUBLIC_DIR%",
8+
"sf-wp-bootstrap.php": "sf-wp-bootstrap.php"
9+
},
10+
"copy-from-package": {
11+
"wp-cli.yml": "wp-cli.yml"
12+
},
13+
"env": {
14+
"WP_PREFIX": "wp_",
15+
"WP_THEME": "wp-blank",
16+
"WP_DIR": "wp",
17+
"AUTH_KEY": "%generate(secret)%",
18+
"SECURE_AUTH_KEY": "%generate(secret)%",
19+
"LOGGED_IN_KEY": "%generate(secret)%",
20+
"NONCE_KEY": "%generate(secret)%",
21+
"AUTH_SALT": "%generate(secret)%",
22+
"SECURE_AUTH_SALT": "%generate(secret)%",
23+
"LOGGED_IN_SALT": "%generate(secret)%",
24+
"NONCE_SALT": "%generate(secret)%"
25+
},
26+
"gitignore": [
27+
"/public/wp/",
28+
"/public/upgrade/",
29+
"/public/uploads/",
30+
"/public/languages/",
31+
"/public/mu-plugins/",
32+
"/public/plugins/",
33+
"/public/themes/"
34+
]
35+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<bg=blue;fg=white> </>
2+
<bg=blue;fg=white> What's next? </>
3+
<bg=blue;fg=white> </>
4+
5+
* update your 'public/index.php' file accordingly to the 'sf-wp-bootstrap.php' file in the root directory.
6+
* Configure doctrine/dbal to ignore custom wordpress tables (such as tables generated by plugins)
7+
* Add the WordpressBundle routing file in your `config/routes.yaml`, after your custom routes to catch all Wordpress routes.
8+
9+
* <fg=blue>Read</> the documentation at <comment>https://github.com/mbo2olivier/mukadi-wordpress-bundle</>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# BEGIN WordPress
2+
<IfModule mod_rewrite.c>
3+
RewriteEngine On
4+
RewriteBase /
5+
RewriteRule ^index\.php$ - [L]
6+
RewriteCond %{REQUEST_FILENAME} !-f
7+
RewriteCond %{REQUEST_FILENAME} !-d
8+
RewriteRule . /index.php [L]
9+
</IfModule>
10+
# END WordPress
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/*
3+
Plugin Name: Symfony Bridge
4+
Plugin URI: http://www.geniusconception.com/
5+
Description: For use symfony service in wordpress, and spread event trought symfony from wp.
6+
Version: 0.0.1
7+
Author: Olivier M. Mukadi
8+
Author URI: http://www.geniusconception.net/
9+
*/
10+
/**
11+
* retreive symfony service
12+
*/
13+
function symfony ($id){
14+
global $sf;
15+
return $sf($id);
16+
}
17+
18+
function symfony_container_ready(){
19+
return isset($GLOBALS['sf']);
20+
}
21+
/**
22+
* dispatch event in symfony
23+
*/
24+
function symfony_dispatch($name, \Mukadi\WordpressBundle\Event\WordpressEvent $event)
25+
{
26+
if (!symfony_container_ready()) return;
27+
return symfony('event_dispatcher')->dispatch($name, $event);
28+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
# nothing here
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php wp_footer(); ?>
2+
</body>
3+
</html>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
6+
// Set theme defaults.
7+
add_action('after_setup_theme', function () {
8+
9+
// Add post thumbnails support.
10+
add_theme_support('post-thumbnails');
11+
12+
// Add title tag theme support.
13+
add_theme_support('title-tag');
14+
15+
// Add HTML5 support.
16+
add_theme_support('html5', [
17+
'caption',
18+
'comment-form',
19+
'comment-list',
20+
'gallery',
21+
'search-form',
22+
'widgets',
23+
]);
24+
25+
register_nav_menu('main', __('Menu Principal','the_theme'));
26+
});
27+
28+
// Enqueue and register scripts the right way.
29+
add_action('wp_enqueue_scripts', function () {
30+
wp_enqueue_style( 'the_theme-style', get_stylesheet_uri(), array());
31+
});
32+
33+
// Remove JPEG compression.
34+
add_filter('jpeg_quality', function () {
35+
return 100;
36+
}, 10, 2);
37+
38+
// Set custom excerpt more.
39+
add_filter('excerpt_more', function () {
40+
return '...';
41+
});
42+
43+
// Set custom excerpt length.
44+
add_filter('excerpt_length', function () {
45+
return 101;
46+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html <?php language_attributes(); ?>>
3+
<head>
4+
<meta charset="<?php bloginfo('charset'); ?>">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<?php wp_head(); ?>
7+
</head>
8+
<body <?php body_class(); ?>>
9+
10+
<header>
11+
<nav role="navigation">
12+
<?php wp_nav_menu(['theme_location' => 'main']); ?>
13+
</nav>
14+
</header>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php get_header(); ?>
2+
3+
<main role="main">
4+
<?php if (have_posts()): while (have_posts()): the_post(); ?>
5+
<article>
6+
<header>
7+
<h1><?php the_title(); ?></h1>
8+
</header>
9+
10+
<?php the_content(); ?>
11+
</article>
12+
<?php endwhile; else: ?>
13+
<article>
14+
<p>Nothing to see.</p>
15+
</article>
16+
<?php endif; ?>
17+
</main>
18+
19+
<?php get_footer();

0 commit comments

Comments
 (0)