elementor/elementor

V2.1 Beta : get page () method is undefined.

pulla opened this issue ยท 9 comments

pulla commented

I have this error ( Notice: PageSettings\Manager is deprecated since version 1.6.0! Use Core\Settings\Page\Manager instead. in )
Even we change it to core\settings\page\manager. get_page() method is not available. ( undefined )

We did like your doc.
https://postimg.cc/image/gxqf15ezb/

I am not sure if it's related to v 2.1. I will create a ticket.

Any solution for it to get post id?

Thank you,

@pulla

You are you using full namespace? \Elementor\Core\Settings\Page\Manager ?

pulla commented

@bainternet

Yes, I used full namespace.
https://s15.postimg.cc/b8t0jfbmz/screenshot_261.png

But still get the error.
https://s15.postimg.cc/fup4rtf6j/screenshot_262.png

get_page() is undefined.

Can you please have a look at yours? or am I missing anything?

pulla commented

@bainternet
I have checked again.

I can't also find get_page() method in manager.php ( \Elementor\Core\Settings\Page\Manager.php )

Am I missing something?

Thank you for your help.

@pulla

I did some digging and get_page method was deprecated since 1.6!!!
anyway not sure what you are trying to do but you can try get_model_for_config or event get_model and see which one works for your use case.

let me know.

pulla commented

Yes, I found this on 2.1.0 beta 1
https://postimg.cc/image/fnzhp47yv/

You have removed "get_page" method.

Then how can we use it instead of? You said to use get_model.... or event get_model. But it didn't work as a static function method.

My question is simple.

https://github.com/pojome/elementor/blob/e69d99e6eba072cdd86f29c09a312a4d8ce3f3ae/docs/content/controls/page-settings.md

we follow your doc for "getting a saved value of a control".
https://postimg.cc/image/4cwu0qtdz/

But it's not working from v2.1. Then please give us a doc instead of that one.

Thank you for your great plugin!

@pulla
again get_page method was deprecated since 1.6!!!
So it's it is now (2.1) removed completely,

If you need the settings then call them as they are (a document) ex:

$document = \Elementor\Plugin::$instance->documents->get( $post_id );
if ( $document ) {
	    $settings = $document->get_settings();
}

Hey, @bainternet. Could you please provide me a link on the actual documentation for v2.1? I've searched for docs here on github and on developers subdomain, but it's all seems outdated. Thanks.

Hi,

I got the same problem like @pulla

I got both a problem with Manager:

"Notice: Elementor\PageSettings\Manager is deprecated since version 1.6.0! Use Elementor\Core\Settings\Page\Manager instead"

(it was called by /elementor/core/document-types/post.php line 9)

And a problem with get_page:

"Notice: Elementor\Core\Settings\Page\Manager::get_page is deprecated since version 1.6.0! Use the new settings API instead"

That was called by:
wp-content/plugins/elementor-pro/modules/custom-css/module.php line 127

which is:
$page_settings_instance = PageSettingsManager::get_page( $post_css->get_post_id() );

@pulla - if you found a solution I'd be greatful if you could share it. Otherwise I'd be glad if @bainternet could help.

Thanks a lot!

@pavner

please feel free to open a new issue describing your problem.