Skip to content

Instantly share code, notes, and snippets.

View onurguven's full-sized avatar
🎯
Focusing

Onur onurguven

🎯
Focusing
View GitHub Profile
@onurguven
onurguven / InjectMediaUrlsListener.php
Created December 2, 2018 21:26 — forked from OskarStark/InjectMediaUrlsListener.php
If you need to get the SonataMedia public urls exposed through the api
<?php
namespace Application\Sonata\MediaBundle\Listener;
use Application\Sonata\MediaBundle\Entity\Media;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Sonata\MediaBundle\Provider\MediaProviderInterface;
use Sonata\MediaBundle\Provider\Pool;
use Symfony\Component\DependencyInjection\ContainerInterface;
@onurguven
onurguven / WP_Query.php
Last active January 20, 2018 01:05 — forked from Dimasmagadan/WP_Query.php
#WordPress query with args
$args = array(
//Author Parameters - Show posts associated with certain author.
'author' => '1,2,3,'
'author_name' => 'luetkemj',
'author__in' => array( 2, 6 ),
'author__not_in' => array( 2, 6 ),
//Category Parameters - Show posts associated with certain categories.
'cat' => 5,