Building WordPress Plugin Using FPDF – How do you get post content from currently viewed post?

I am using FPDF to build a plugin in wordpress that will add a button on each post(documentation) that gives the user the ability to export it as a styled pdf from the post without having to maintain working files and uploading attachements for hundreds of files.

I used this as a guide, and it currently works in one respect, however this current iteration exports a PDF of ALL posts in the documentation post type. How do I instead pull the post content from the currently viewed post only?

I have been banging my head for a week, so hopefully someone can point me in the right direction. Let me know if I can clarify anything additional.

Thanks!

<?php  if ( ! defined( 'ABSPATH' ) ) { exit; }  include( 'atomicsmash-pdf-helper-functions.php');  $  pdf = new PDF_HTML();  if( isset($  _POST['generate_posts_pdf'])){ output_pdf(); }  function output_pdf() { $  args = array(     'post_type'   => 'manual_documentation'   );  $  posts = get_posts( $  args );  if( ! empty( $  posts ) ) {     global $  pdf;     $  title_line_height = 10;     $  content_line_height = 8;      foreach( $  posts as $  post ) {          $  pdf->AddFont( 'Lato', '', 'Lato-Regular.php' );         $  pdf->AddFont( 'Lato', 'B', 'Lato-Bold.php' );         $  pdf->AddFont( 'Lato', 'I', 'Lato-Italic.php' );         $  pdf->SetMargins(12.7, 12.7);         $  pdf->SetDrawColor(36,161,89);          $  pdf->AddPage();         $  pdf->SetFont( 'Lato', 'B', 24 );         $  pdf->SetTextColor(4,23,51);         $  pdf->Write($  title_line_height, $  post->post_title);          $  pdf->SetLineWidth(1);         $  pdf->Line(14, 27, 40, 27);          // Add a line break         $  pdf->Ln(14);          // Image         $  page_width = $  pdf->GetPageWidth() - 20;         $  max_image_width = $  page_width;          $  image = get_the_post_thumbnail_url( $  post->ID );         if( ! empty( $  image ) ) {             $  pdf->Image( $  image, null, null, 100 );         }                  // Post Content         $  pdf->Ln(10);         $  pdf->SetFont( 'Lato', '', 10 );         $  pdf->SetTextColor(38,59,71);         $  pdf->WriteHTML($  post->post_content);     } }  $  pdf->Output('D','atomic_smash_fpdf_tutorial.pdf'); exit; }  function as_fpdf_create_admin_page() {  ?>  <div class="wrap"> <form method="post" id="as-fdpf-form">     <button class="custom-botton" type="submit" name="generate_posts_pdf" value="generate">Download PDF</button> </form> </div>  <?php }  function register_shortcodes(){ add_shortcode('fpdf-doc', 'as_fpdf_create_admin_page'); }  add_action( 'init', 'register_shortcodes'); 

Why Can’t Embedded SharePoint Videos Be Viewed in Full Screen

I’m using Microsoft Edge w/ Windows 10 and I’m embedding videos on SharePoint pages from the the Office 365 Video Portal.

For some reason the allow full screen code is being stripped out after the code is saved to the page. Take a peek to see what happens graphically and the 2 different versions of code.

Is This a SharePoint Bug?

What is the alternative for modern experience “most viewed item”?

I know that classic experience has this option where you can see the most viewed items inside a document library.

What is the equivalent of this feature inside modern experience document library?

We have thousands of files, and only a few of them are frequently used. Views and filtering are used but don’t really solve this problem.

Is there a way so the default of Document Library shows only the most used items and not thousands of other items that are rarely used?

Keeping in mind that I can’t know which items are mostly used due to the fact that our Sharepoint online has a of of users

Could a spellbook be destroyed/emptied by being viewed by someone else?

In my first ever game of D&D (this was many years ago), I joined an existing game, and at the table, I was sitting beside a player playing a wizard (or “Magic User” to use the parlance of the time). The player had a little notebook to represent her spell-book, so at one point out of idle curiosity, I picked it up and flicked through it.

Another player at the table jumped up and pointed, shouting out with glee (we were kids) that I had read the wizard’s spell-book, as it turns out that if anyone other than the wizard herself looks at it, all the spells would vanish from the book.

So the GM declared that this indeed is what happened, she would have to start a new spellbook, collecting her spells all over again and the wizard player spent the rest of the session understandably unhappy, glaring & cursing at me and so on.

Has this ever been a rule in D&D?

In all my years of playing (OD&D – which I believe this was, AD&D 2nd Ed, 3, 3.5, etc.) I have never come across a rule like this. I suppose it’s possible she had a curse or something but in the ensuing argument this was never mentioned – they seemed to be making out that it was just a rule about spellbooks, and that I should have just somehow known not to do this.

Extending Recently Viewed & Recently Compared Grids

I am struggling to extend the following two files in mageno 2.3.1

\vendor\magento\module-reports\view\frontend\templates\widget\viewed\content\viewed_grid.phtml

and

\vendor\magento\module-reports\view\frontend\templates\widget\compared\content\compared_grid.phtml

I tried extending them at:

\ME\THEME\Magento_Reports\templates\widget\compared\content\compared_grid.phtml

and

\ME\THEME\Magento_Reports\templates\widget\viewed\content\viewed_grid.phtml

I then ran setup:upgrade and setup:static-content:deploy -f

But no changes took place.

To troubleshoot I then tried editing the files in their original location. Ran “setup:upgrade” and “setup:static-content:deploy -f “

But still no changes?

Are these files no longer used?

To clarify it is the blocks that are inputed into the TinyMce Editor as below image. enter image description here

Any Help much appreciated.

What info are exposed inside the site activity modern web part? can i know what other users viewed?

I have added a “Site Activity” web part inside our modern team site. and to check what this web part expose >> i login using 2 different users (UserA & UserB).

UserA. will see what he/she have viewed and what others have edited.

UserB. will see what he/she have viewed and what others have edited.

so can i conclude that the site activity web part will never expose what other users have viewed? and will only expose this view info to the same user ? or this is not always the case?

Thanks

Why the instagram story cannot be viewed?

There are three Instagram accounts: A, B, C.

  • A is public.
  • A and B follow each other.
  • C is freshly created, it doesn’t follow anyone and is not banned by anyone.

A posts a story.

  • B can see that there is an unseen story by A (and can check it out).
  • Unauthorised user can see that there is an unseen story by A (colourful circle around the avatar), but cannot open it (which is expected).
  • C cannot see that there are any unseen stories by A (colourful circle disappears).

How is it possible?

My guess was that A shared the story with some of their ‘close friends’ (including B), so unauthorised user can see ‘there is something’, but as soon as they log in as C, they can’t see it anymore. But when I share some story with some close friends, an unauthorised user won’t see the colourful circle at all.

How do I allow the Documents library in an Office 365 Group site allow ASPX pages to be viewed?

If I upload an ASPX file to the documents library in a regular SharePoint site, it renders properly when a user clicks on the file.

If I do the same for an ASPX file uploaded to the documents library in a SharePoint site that backs an Office 365 Group, the ASPX file is not rendered, but downloaded instead. Is there any way to get SharePoint to render ASPX files?

Additional information:

  • Setting the “Default open behavior for browser-enabled documents” in the advanced library settings to “open in the browser” does not help.
  • A SharePoint site behind an Office 365 group has a Pages library that obviously allows ASPX files. I am unable to upload to that library via the browser, but I suspect I could do this via code. I wonder if there is some specific setting on the document library that turns on this behavior. If so, I couldn’t find it.
  • I am aware of permissive file handling and that the default value for this does not allow rendering of HTML files. However, this does not appear to affect ASPX files. Interestingly, I am now unable to perform a set-spotenant -PermissiveBrowserFileHandlingOverride $ true in my test tenant. I get back a message indicating that “Permissive browser file handling setting is deprecated and can’t be enabled.”