Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble as well as for the late reply. I’ve been on holidays and therefore couldn’t reply earlier.

    Unfortunately, I can not dive into this very deeply, due to time reasons. My assumption here is that Shortcodes are not evaluated by that plugin. Do you know, if it’s running in the “front-end” context or in the “admin area” context?

    Regards,
    Tobias

    Thread Starter vincepettit

    (@vincepettit)

    Hi Tobias, I’m not sure about the context, I’ve contacted the other plugin creators to see if they can let me know!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    great, thanks a lot!
    The reason why I’m asking is that TablePress only registers its Shortcodes on the frontend.

    Regards,
    Tobias

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    great, thanks a lot!
    The reason why I’m asking is that TablePress only registers its Shortcodes on the frontend.

    Regards,
    Tobias

    Thread Starter vincepettit

    (@vincepettit)

    Hi Tobias, apparently it is running in Admin context.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    okay, thanks for the confirmation. We could then maybe try to load the Shortcodes in the admin area as well. For that, please try adding this to the “functions.php” file of your theme:

    $tablepress_frontend_controller = TablePress::load_controller( 'frontend' );
    $tablepress_frontend_controller->init_shortcodes();

    Regards,
    Tobias

    Thread Starter vincepettit

    (@vincepettit)

    If I do that I get this error on the frontend and nothing loads:

    Fatal error: Uncaught Error: Call to a member function get() on null in /wp-content/plugins/tablepress/classes/class-controller.php:89 Stack trace: #0 /wp-content/plugins/tablepress/classes/class-controller.php(69): TablePress_Controller->plugin_update_check() #1 /wp-content/plugins/tablepress/controllers/controller-frontend.php(37): TablePress_Controller->__construct() #2 /wp-content/plugins/tablepress/classes/class-tablepress.php(208): TablePress_Frontend_Controller->__construct(NULL) #3 /wp-content/plugins/tablepress/classes/class-tablepress.php(261): TablePress::load_class('TablePress_Fron...', 'controller-fron...', 'controllers') #4 /wp-content/themes/presso/functions.php(351): TablePress::load_controller('frontend') #5 /homepages/19/d85070 in /wp-content/plugins/tablepress/classes/class-controller.php on line 89

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ah, bummer. Then let’s give this more complex code a try:

    function run_tablepress_shortcodes_in_admin() {
    	if ( is_admin() ) {
    		TablePress::$model_options = TablePress::load_model( 'options' );
    		TablePress::$model_table = TablePress::load_model( 'table' );
    		$GLOBALS['tablepress_frontend_controller'] = TablePress::load_controller( 'frontend' );
    	}
    }
    add_action( 'tablepress_run', 'run_tablepress_shortcodes_in_admin' );

    Regards,
    Tobias

    Thread Starter vincepettit

    (@vincepettit)

    There’s no error now and it isn’t showing a shortcode but there is also no table in the article

    Original article – https://www.thecheckeredflag.co.uk/2016/04/wec-preview-6-hours-silverstone/

    Apple News article (needs to be viewed on apple device otherwise it links to original) – https://apple.news/A_O4UsgUhTN2YYnxkMpknWw

    Table in question is at the end of the article

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ah, too bad ?? Unfortunately, I’m out of ideas here, then ??
    Could it be Apple stripping the HTML table?

    Regards,
    Tobias

    Thread Starter vincepettit

    (@vincepettit)

    Standard HTML tables are parsed correctly…

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    hhm, really strange then. Unfortunately, I have no idea how we could check the content that Apple sees/gets ??

    Regards,
    Tobias

    Thread Starter vincepettit

    (@vincepettit)

    This is a sample what is sent through to Apple in the XML that is submitted that includes a tablepress table:

    The session times for this weekend (April 15-16) are as follows:\n\n \n\n[table id=959 /]

    That was without the code in functions, if I add the code to functions it just doesn’t show anything:

    The session times for this weekend (April 15-16) are as follows:\n\n

    Thread Starter vincepettit

    (@vincepettit)

    So basically Apple isn’t getting sent the data when the code is added to the functions but the looks of it

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    an empty value for the table? TablePress should never return that (it would at least print an HTML comment stating that a table is empty, or something like that)…

    Could something else be stripping it? Unfortunately, I don’t really know how we could continue debugging this ??

    Regards,
    Tobias

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Tablepress Apple News’ is closed to new replies.