Access Anthologize From Frontend

25 views
Skip to first unread message

Lehi Drew

unread,
Jun 30, 2014, 9:14:25 AM6/30/14
to antholo...@googlegroups.com
The next thing I'm trying to accomplish is the ability to allow users to use Anthologize from the frontend of the website.

I am not sure the best way to go about this.  If anybody here knows how to do something like that, I would appreciate it.

If I figure that out, I will surely post about it here.

Lehi Drew

unread,
Jul 12, 2014, 8:53:34 PM7/12/14
to antholo...@googlegroups.com
I am now getting this error: Catchable fatal error: Object of class Anthologize could not be converted to string in /home/server/mydomain.com/wp-includes/shortcodes.php on line 287

Boone B Gorges

unread,
Jul 14, 2014, 9:42:44 AM7/14/14
to antholo...@googlegroups.com
Lehi - What are you doing that leads you to this error?

On 07/12/2014 08:53 PM, Lehi Drew wrote:
> I am now getting this error: *Catchable fatal error*: Object of class
> Anthologize could not be converted to string in
> */home/server/mydomain.com/wp-includes/shortcodes.php* on line *287*
>
> On Monday, June 30, 2014 8:14:25 AM UTC-5, Lehi Drew wrote:
>
> The next thing I'm trying to accomplish is the ability to allow
> users to use Anthologize from the frontend of the website.
>
> I am not sure the best way to go about this. If anybody here knows
> how to do something like that, I would appreciate it.
>
> If I figure that out, I will surely post about it here.
>
> --
> You received this message because you are subscribed to the Google
> Groups "anthologize-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to anthologize-d...@googlegroups.com
> <mailto:anthologize-d...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Lehi Drew

unread,
Jul 14, 2014, 8:18:08 PM7/14/14
to antholo...@googlegroups.com
I created a shortcode and put that shortcode on a particular page. The error occurs precisely in the content part of the page that I put that shortcode. Nothing else is affected. I also got a similar Catchable Fatal Error when I tried to using the plugin Ajaxize before I tried doing the shortcode.

Boone B Gorges

unread,
Jul 15, 2014, 8:02:42 AM7/15/14
to antholo...@googlegroups.com
Yes, but what does the shortcode do? Can you share the add_shortcode()
callback function?

On 07/14/2014 08:18 PM, Lehi Drew wrote:
> I created a shortcode and put that shortcode on a particular page. The
> error occurs precisely in the content part of the page that I put that
> shortcode. Nothing else is affected. I also got a similar Catchable
> Fatal Error when I tried to using the plugin Ajaxize before I tried
> doing the shortcode.
>
> On Monday, July 14, 2014 8:42:44 AM UTC-5, Boone wrote:
>
> Lehi - What are you doing that leads you to this error?
>
> On 07/12/2014 08:53 PM, Lehi Drew wrote:
> > I am now getting this error: *Catchable fatal error*: Object of class
> > Anthologize could not be converted to string in
> > */home/server/mydomain.com/wp-includes/shortcodes.php*
> <http://mydomain.com/wp-includes/shortcodes.php*> on line *287*
> >
> > On Monday, June 30, 2014 8:14:25 AM UTC-5, Lehi Drew wrote:
> >
> > The next thing I'm trying to accomplish is the ability to allow
> > users to use Anthologize from the frontend of the website.
> >
> > I am not sure the best way to go about this. If anybody here
> knows
> > how to do something like that, I would appreciate it.
> >
> > If I figure that out, I will surely post about it here.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "anthologize-dev" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to anthologize-d...@googlegroups.com <javascript:>
> > <mailto:anthologize-d...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "anthologize-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to anthologize-d...@googlegroups.com
> <mailto:anthologize-d...@googlegroups.com>.

Lehi Drew

unread,
Jul 15, 2014, 4:49:55 PM7/15/14
to antholo...@googlegroups.com
I added 1 line of code at the very end to make the wrapper function callable via shortcode, as you will see below.


/**
 * A wrapper function that allows access to the Anthologize singleton
 *
 * We also use this function to bootstrap the plugin.
 *
 * @since 0.7
 */
add_shortcode('anthologize_shortcode', 'anthologize');

function anthologize() {
    return Anthologize::init();
}

$_GLOBALS['anthologize'] = anthologize();
>     > <mailto:anthologize-dev+unsub...@googlegroups.com <javascript:>>.
>     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "anthologize-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to anthologize-d...@googlegroups.com

Boone B Gorges

unread,
Jul 15, 2014, 4:58:39 PM7/15/14
to antholo...@googlegroups.com
Aha. Unfortunately, it will not be nearly so easy to make this work. A
few thoughts:

- There's no need to initialize Anthologize like this. The plugin itself
already does it.
- The 'anthologize_shortcode' callback has to return a string value,
consisting of whatever markup you want to display on the page.
Anthologize::init() returns the Anthologize bootstrapper singleton.
- In the Dashboard, Anthologize content is output to the screen using
the WP add_submenu_page() API. Have a look in
anthologize/includes/class-admin-main.php to see how this function is
called for each different kind of Anthologize screen. You will have to
build your own wrapper that does some sort of logic (maybe based on URL)
to determine which of Anthologize's screens should be shown, and then to
call the necessary display methods (such as
Anthologize_Admin_Main::display())
- Much of Anthologize is heavily dependent on CSS and JS that is
explicitly loaded only on our pages in the Dashboard. You'll have to
load it on the front end as necessary. See eg
Anthologize_Admin_Main::load_scripts()
- There will probably also be places where Anthologize depends on WP
core styles that are dependent on the WP Dashboard. You'll have to load
those too, or reproduce the necessary chunks somehow.

Making this work fairly seamlessly is a large project, as Anthologize
was unfortunately not built in a modular enough way to make it portable
in the way you need. It can certainly be done, but it will take a lot of
work.
> > <http://mydomain.com/wp-includes/shortcodes.php*
> <http://mydomain.com/wp-includes/shortcodes.php*>> on line *287*
> > >
> > > On Monday, June 30, 2014 8:14:25 AM UTC-5, Lehi Drew wrote:
> > >
> > > The next thing I'm trying to accomplish is the ability
> to allow
> > > users to use Anthologize from the frontend of the website.
> > >
> > > I am not sure the best way to go about this. If anybody
> here
> > knows
> > > how to do something like that, I would appreciate it.
> > >
> > > If I figure that out, I will surely post about it here.
> > >
> > > --
> > > You received this message because you are subscribed to the
> Google
> > > Groups "anthologize-dev" group.
> > > To unsubscribe from this group and stop receiving emails
> from it,
> > send
> > > an email to anthologize-d...@googlegroups.com <javascript:>
> > > <mailto:anthologize-d...@googlegroups.com
> <javascript:> <javascript:>>.
> > > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "anthologize-dev" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to anthologize-d...@googlegroups.com <javascript:>
> > <mailto:anthologize-d...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "anthologize-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to anthologize-d...@googlegroups.com
> <mailto:anthologize-d...@googlegroups.com>.

Lehi Drew

unread,
Jul 15, 2014, 7:59:50 PM7/15/14
to antholo...@googlegroups.com
Thank you very much for your thorough and thought out reply.  It looks like I have my work cut out for me, but I think it will be worth it.
>     <javascript:> <javascript:>>.
>     >     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>
>     >     <https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>>.
>     >
>     > --
>     > You received this message because you are subscribed to the Google
>     > Groups "anthologize-dev" group.
>     > To unsubscribe from this group and stop receiving emails from it,
>     send
>     > an email to anthologize-d...@googlegroups.com <javascript:>
>     > <mailto:anthologize-dev+unsub...@googlegroups.com <javascript:>>.
>     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "anthologize-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to anthologize-d...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages